1932 Commits

Author SHA1 Message Date
Jessica Janiuk eaaa294e49 docs: update peek-a-boo example (#47219)
The peek-a-boo example image does not exactly reflect what happens. This updates the hook table and the image of the peek-a-boo output. Closes #40138

PR Close #47219
2022-08-22 16:03:18 -07:00
Bob Watson bb465e1789 docs: set titles to sentence case (#47083)
* update overview and reviewing topics to accommodate new ToC
* incorporate edits from peer reviews

PR Close #47083
2022-08-12 18:04:26 +02:00
Bob Watson 09d57530db docs: clarify use of unsubscribe with HttpClient (#47127)
fix: #46542

PR Close #47127
2022-08-12 09:58:05 +00:00
Sonu Kapoor bb40a08164 docs: rename duplicate header (#47110)
PR Close #47110
2022-08-11 16:08:38 +00:00
Leosvel Pérez Espinosa c365cfab03 docs: remove duplicated sentence (#47126)
PR Close #47126
2022-08-11 16:04:16 +00:00
4javier f4fa4afd04 docs: clarify providers' injection in lazy loaded modules (#47094)
Addresses https://github.com/angular/angular/issues/47059
I try to keep the edit as concise as possible because adding any further
explanation would bring to much deeper info compared to the topic of the
page

Removed some convoluted info and replaced with a link to a page that
should focus on the specific aspect of the matter.
Conditional is obliged because IMHO that page should have a dedicated
paragraph explaining various ways of populating different injectors with
providers, and maybe integrating the interesting parts from the recent
created page about standalone app.
PR Close #47094
2022-08-10 10:45:04 -07:00
Vovch 38d23af419 docs: change "zone" to "ngZone" in an example (#47079)
Change requesting "this.zone" to "this.ngZone" in the Plotly example, as it corresponds to the name declared in the constructor.
PR Close #47079
2022-08-09 10:01:27 -07:00
Bob Watson 874d78b502 docs: add more documentation about lint messages (#47019)
Adds suggestions for how to resolve the most common messages produced by the documentation linter.

Adds links to the Proselint and other style tests to the new documentation.

Updates pullapprove and navigation.

PR Close #47019
2022-08-08 11:34:56 -07:00
Edward 30c9e80a30 docs: fix dependecy injection documentation page typos (#47057)
PR Close #47057
2022-08-08 11:33:05 -07:00
Roman Matusevich e46972ac4b docs: fix text formatting for paragraph in Hierarchical injectors (#47067)
Paragraph of text is not wrapped into `p` tag due to missing empty line after the `div` block. The fix is just add an empty line.

PR Close #47067
2022-08-08 11:31:44 -07:00
Pawel Kozlowski 2e42bb9c62 docs: update link to the TypeScript handbook (#47075)
Closes #47070
PR Close #47075
2022-08-08 11:31:19 -07:00
Jan Melcher fd2abebf91 docs: fix link in dependency injection guide (#47055)
PR Close #47055
2022-08-08 09:23:06 -07:00
ileil 387f4a79f8 docs: update dependency injection content (#44466)
Refactored the DI section to improve doc quality, reduce cognitive load and drive consistency.

- Added an overview with prerequisites and doc cards that point to rest of the DI content
- Added introduction topic with topic purpose, value proposition and "fail fast"
- Broke apart complex concepts into simpler tasks
- Unified tone and language for each topic
- Added new content based on SME feedback
- Deleted obsolete content

PR Close #44466
2022-08-05 10:06:14 -07:00
Andrew Scott 79825d3f10 fix(router): Do not call preload method when not necessary (#47007)
In Angular 14, we introduced the `loadComponent` API for a `Route` to
allow lazy loading of a routed component in addition to the existing
`loadChildren` which allows lazy loading of child routes. As a result,
the `preload` method of the `PreloadingStrategy` needs to sometimes be
called even when there is a `canLoad` guard on the `Route`. `CanLoad`
guards block loading of child routes but _do not_ block loading of the
component.

This change updates the conditional checks in the internal preloader to
skip calling the `PreloadingStrategy.preload` when there is only a
`loadChildren` callback with a `canLoad` guard an no `loadComponent`.
In this case, the callback passed to the `preload` method is already
effectively a no-op so it's not necessary to call it at all.

resolves #47003

PR Close #47007
2022-08-02 09:38:28 -07:00
Marek Hám b6445c4cd6 docs: fix link to live example (#47011)
Fixes #46975

PR Close #47011
2022-08-01 14:20:37 -07:00
Durairaj Subramaniam d05d05e48e docs: fix link in routing (#46988)
PR Close #46988
2022-08-01 13:00:25 -07:00
Roman Matusevich ce6ad5a66a docs: fix selector in Component Interaction guide (#46995)
The selector for the `CountdownTimerComponent` is `app-countdown-timer`
not `countdown-timer`.

PR Close #46995
2022-08-01 11:16:31 -07:00
Asaf M cbfd91b0f2 docs: fixed typos (#47008)
Used my script: https://github.com/Uziel302/websites-spell-checker/blob/master/mdnversion

PR Close #47008
2022-08-01 11:15:55 -07:00
Andrew Quinn 71831c63ba docs: fix typo in guide/structural-directives page (#46961)
Fix typo [missing plural marker "element_s_"] on https://angular.io/guide/structural-directives.

Original:
>Structural directives are directives which change the DOM layout by adding and removing DOM element.

Fix:
>Structural directives are directives which change the DOM layout by adding and removing DOM element**s**.
PR Close #46961
2022-08-01 09:29:40 -07:00
Ivaylo Kirov 6b779b11d1 docs: add missing period to the Security guide (#46900)
PR Close #46900
2022-07-22 15:37:30 +00:00
Andrew Kushnir 55f485b3bb refactor(platform-server): include TransferState providers into ServerModule (#46899)
This commit updates the code to include the TransferState providers (used for serialization) into the `ServerModule` instead of having the need to import the `ServerTransferStateModule` separately.

The list of providers in the `ServerTransferStateModule` is now empty and importing it is a noop. This is not a breaking change, since the `ServerModule` must be included anyways to make server rendering work correctly.

PR Close #46899
2022-07-21 12:17:43 +00:00
Andrew Kushnir a8e9247e6a refactor(platform-server): make TransferState standalone-friendly (#46879)
This commit updates the `TransferState` to make it `providedIn: 'root'`. This makes the entire `BrowserTransferStateModule` module unnecessary, so it got deprecated as well.

The `ServerTransferStateModule` is still retained, but the `renderApplication` function now also includes the necessary tokens to serialize the `TransferState` automatically, so when using the `renderApplication` function, there is no need to include `ServerTransferStateModule` as well.

This change is a part of the ongoing efforts to update the shape of the FW APIs to make them standalone-friendly (so there is no need to import any NgModules).

PR Close #46879
2022-07-20 11:05:08 -07:00
Bob Watson 17e2a2a9d1 docs: add info about request timeouts (#46882)
* Adds a short note about how service workers report request timeouts
* Updated heading levels to present a clearer hierarchy and cleaner local TOC
* Removed documentation lint errors
* Moves the service worker service timeout paragraph to a more logical topic in service-worker-devops
* Removes line error from the more logical topic.
* address feedback from PR review comments

fixes #46445

PR Close #46882
2022-07-20 08:48:00 -07:00
Bob Watson 9ecaa05c7d docs: correct debugging task step (#46832)
Also remove lint errors.

Fix: #42781

PR Close #46832
2022-07-13 22:55:21 +00:00
acvi 4dca1842b3 docs: describe smallest typo, "an" -> "a" (#46812)
PR Close #46812
2022-07-13 20:06:30 +00:00
Bob Watson e91d6241b5 docs: clarify how ng adds classes to form elements (#46805)
* Clarify text described in #46424
* Remove lint errors
* Fix #46424

PR Close #46805
2022-07-12 19:09:04 +00:00
Ivaylo Kirov 10495a8405 docs: Add missing period (#46799)
This adds a missing period in one documentation sentence.

PR Close #46799
2022-07-12 19:04:27 +00:00
Andrew Kushnir a6d5fe202c feat(core): alias createNgModuleRef as createNgModule (#46789)
This commit adds the `createNgModuleRef` function alias to the public API. The alias is called `createNgModule`. The `createNgModule` name is more consistent with the rest of the API surface, where functions that return `*Ref`s don't include the `Ref` into the function name, for example: `createPlatform`, `ViewContainerRef.createComponent`, etc.

DEPRECATED:

The `createNgModuleRef` is deprecated in favor of newly added `createNgModule` one.

PR Close #46789
2022-07-12 16:11:41 +00:00
Lukas Matta 397d75bc4c docs: add missing space (#46800)
PR Close #46800
2022-07-12 15:56:09 +00:00
Bob Watson 50830a2bc7 docs: update topics to include feedback from PR review (#46647)
Fix #44662

PR Close #46647
2022-07-11 22:32:35 +00:00
Bob Watson 9d030dadd3 docs: update references to HeroListComponent (#46647)
Remove or reframe references to the obsolete HeroListComponent component that was taken from an old version of the Tour of Heroes tutorial.

Incorporates review feedback.

Fix #44662

PR Close #46647
2022-07-11 22:32:35 +00:00
markostanimirovic b6a950cd60 docs(core): add full example of directive with typed context (#46689)
This commit adds a complete example of a structural directive
with strongly typed context.

PR Close #46689
2022-07-11 20:01:06 +00:00
SoulsMark e58207e444 docs: link fix from google.developers to web.dev (#46768)
PR Close #46768
2022-07-11 18:14:59 +00:00
Or'el Ben-Ya'ir ea0f07a858 docs(router): fix minor typos in tutorial (#46696)
PR Close #46696
2022-07-08 17:57:44 +00:00
dario-piotrowicz 350e3643c5 docs(animations): add section about animations and view encapsulation (#46738)
Add a section regarding component view encapsulations in the complex animation
sequences guide to let developers know how animations work in regard to
view encapsulations.

This section is used to both add information to the guide but also to
take a stand on how the animations should behave in regard to the
shadow dom view encapsulation.

This relates to PR #46488 which by trying to make sure the query
function works with shadow dom elements proved that having the
animations implementation work with shadow dom would increase the
complexity of the code and would have a negative impact on performance,
such facts alongide the small adoption of shadow dom by users influenced
the decision to keep the current functionalities and simply discourage
the use of animations and shadow dom components.

PR Close #46738
2022-07-07 13:52:33 -07:00
George Kalpakas b80a6e29cd docs(elements): fix typo in guide (@ --> @) (#46688)
HTML entities should not be used inside single backtick code blocks,
because they are not automatically decoded.

PR Close #46688
2022-07-06 07:31:15 -07:00
Alan Agius 5fd3bb6a15 docs: replace fix typo in (#46659)
`extract-18n` should be `extract-i18n`

PR Close #46659
2022-07-06 07:30:14 -07:00
Bob Watson db631bebbf docs: move section on subscribing to observable (#46655)
This change moves a section of the text to a more logical location in the document flow.

fixes #43235

PR Close #46655
2022-07-01 10:23:46 -07:00
Andrew Scott 7dea2892c0 docs: fix breaking change note in v14 (#46603)
The breaking change note for one change was truncated

PR Close #46603
2022-06-29 10:07:43 -07:00
Chad Ramos 528ff13f61 docs: Grammer update (#46567)
Missing `in`.
PR Close #46567
2022-06-28 21:40:20 -07:00
Aristeidis Bampakos fac6944ff7 docs: fix typos in several guides (#46453)
PR Close #46453
2022-06-22 09:14:53 -07:00
behrooz bozorg chami 1aa27ebbad docs: fix base href haser tag (#46431)
I add '>' end of header tag
Fixes #46430

PR Close #46431
2022-06-21 11:47:04 -07:00
markostanimirovic cdd19bd30e docs(core): add full example for IfLoadedDirective (#46425)
This commit adds a full example for the IfLoadedDirective and moves
the code to the StackBlitz playground for structural directives.

Fixes #40739, #37119

PR Close #46425
2022-06-21 11:46:26 -07:00
4javier d1e5ef51b6 docs: fix link to unpkged locales (#46379)
Add trailing slash to url
PR Close #46379
2022-06-15 14:05:14 -07:00
Aakash 2509d7681b docs: Add missing line in *zone-flags.ts* file for event-binding wiki. (#46369)
PR Close #46369
2022-06-15 14:04:43 -07:00
Andrew Scott de058bba99 feat(router): Add CanMatch guard to control whether a Route should match (#46021)
Currently we have two main types of guards:
`CanLoad`: decides if we can load a module (used with lazy loading)
`CanActivate` and friends. It decides if we can activate/deactivate a route.
So we always decide where we want to navigate first ("recognize") and create a new router state snapshot. And only then we run guards to check if the navigation should be allowed.
This doesn't handle one very important use case where we want to decide where to navigate based on some data (e.g., who the user is).
I suggest to add a new guard that allows us to do that.

```
[
  {path: 'home', component: AdminHomePage, canUse: [IsAdmin]},
  {path: 'home', component: SimpleHomePage}
]
```

Here, navigating to '/home' will render `AdminHomePage` if the user is an admin and will render 'SimpleHomePage' otherwise. Note that the url will remain '/home'.

With the introduction of standalone components and new features in the Router such as `loadComponent`,
there's a case for deprecating `CanLoad` and replacing it with the `CanMatch` guard. There are a few reasons for this:

* One of the intentions of having separate providers on a Route is that lazy
loading should not be an architectural feature of an application. It's an
optimization you do for code size. That is, there should not be an architectural
feature in the router to specifically control whether to lazy load something or
not based on conditions such as authentication. This is a slight nuanced
difference between the proposed canUse guard: this guard would control whether
you can use the route at all and as a side-effect, whether we download the code.
`CanLoad` only specified whether the code should be downloaded so canUse is more powerful and more appropriate.
* The naming of `CanLoad` will be potentially misunderstood for the `loadComponent` feature.
Because it applies to `loadChildren`, it feels reasonable to think that it will
also apply to `loadComponent`. This isn’t the case: since we don't need
to load the component until right before activation, we defer the
loading until all guards/resolvers have run.

When considering the removal of `CanLoad` and replacing it with `CanMatch`, this
does inform another decision that needed to be made: whether it makes sense for
`CanMatch` guards to return a UrlTree or if they should be restricted to just boolean.
The original thought was that no, these new guards should not allow returning UrlTree
because that significantly expands the intent of the feature from simply
“can I use the route” to “can I use this route, and if not, should I redirect?”
I now believe it should allowed to return `UrlTree` for several reasons:

* For feature parity with `CanLoad`
* Because whether we allow it as a return value or not, developers will still be
able to trigger a redirect from the guards using the `Router.navigate` function.
* Inevitably, there will be developers who disagree with the philosophical decision
to disallow `UrlTree` and we don’t necessarily have a compelling reason to refuse this as a feature.

Relates to #16211 - `CanMatch` instead of `CanActivate` would prevent
blank screen. Additional work is required to close this issue. This can
be accomplished by making the initial navigation result trackable (including
the redirects).
Resolves #14515
Replaces #16416
Resolves #34231
Resolves #17145
Resolves #12088

PR Close #46021
2022-06-13 22:53:49 +00:00
Tom Eustace adb21a2416 docs: add angular#bundler to Enforcing Trusted Types section (#45450)
When a Content Security Policy is defined that uses trusted-types in an application that uses lazy chunk files, ng
serve will be broken as angular#bundler entry needs to be added to
Content Security Policy.

Fixes #44647

PR Close #45450
2022-06-10 16:11:41 +00:00
alefra 55a0efede2 docs: modify header and path (#45828)
Change header and path to match with file in the example folder

PR Close #45828
2022-06-10 16:11:09 +00:00
alefra d6c370bc67 docs: modify header and path of code-example (#45828)
In the example, @ContentChild is used in app.component.ts but the component we want to project content into is example-zippy.component.ts.
PR Close #45828
2022-06-10 16:11:09 +00:00
dario-piotrowicz 51297e1493 docs: fix "for to learn more" typo (#46095)
PR Close #46095
2022-06-10 14:24:37 +00:00