Commit Graph

4024 Commits

Author SHA1 Message Date
Tristan Sprößer 383090858c feat(service-worker): support sendRequest as a notificationclick action (#46912)
Implement a new `notificationclick` action, `sendRequest`, which sends a
GET request to the specified URL, without opening a new window. This can
be useful for hitting an API endpoint.

PR Close #46912
2022-08-01 09:51:55 -07:00
Aristeidis Bampakos 0a5abf3093 docs: modify callout in TOH part 2 (#46964)
PR Close #46964
2022-08-01 09:30:04 -07:00
Andrew Quinn aadcc13106 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 d4c9523e36 docs: add missing period to the Security guide (#46900)
PR Close #46900
2022-07-22 15:37:30 +00:00
Simona Cotin afa6050a11 docs: add simona cotin to contributors (#46922)
PR Close #46922
2022-07-22 08:27:08 +00:00
Andrew Kushnir 46c44de0cc 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 a0b2d36415 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 0d192e8d0b 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:47:59 -07:00
piyush132000 4a68b0f6ab docs: fix code style (#46862)
PR Close #46862
2022-07-18 16:44:20 +00:00
Cédric Exbrayat 426af91a42 feat(forms): add FormBuilder.record() method (#46485)
The new `FormRecord` entity introduced in Angular v14 does not have its builder method.
This commit adds it, allowing to write:

```
const fb = new FormBuilder();
fb.record({ a: 'one' });
```

This works for both the `FormBuilder` and the `NonNullableFormBuilder`

PR Close #46485
2022-07-15 22:02:44 +00:00
Bob Watson 211c35358a docs: correct debugging task step (#46832)
Also remove lint errors.

Fix: #42781

PR Close #46832
2022-07-13 22:55:20 +00:00
acvi 22c40b420e docs: describe smallest typo, "an" -> "a" (#46812)
PR Close #46812
2022-07-13 20:06:30 +00:00
Bob Watson 24decdef79 docs: add warning about lack of testing used by TOH (#46811)
Adds a short note about how the .spec.ts testing files aren't used or modified in this tutorial.

Fixes #37652

PR Close #46811
2022-07-13 00:03:49 +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
Nicolas Molina Monroy 23e7f7f2f3 docs: add nicobytes to GDE resources and Platzi to Online Training (#46668)
PR Close #46668
2022-07-11 23:29:30 +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
Bob Watson 8271da9dbb docs: Remove content lint errors from tutorial topics (#46652)
Contains revisions to the Tour of Heroes tutorial that remove the text and formatting errors identified by the content lint tool.

PR Close #46652
2022-07-11 21:44:58 +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
Paul Gschwendtner 5dd9d4ae01 build: account for rename of angular/code-of-conduct default branch (#46640)
We just renamed the Angular code of conduct repository default branch
to `main`. This repository was not part of the large migration and is
now handled separately as a little clean-up.

PR Close #46640
2022-06-30 12:44:05 -07:00
Aristeidis Bampakos 39c02f1c9d docs(router): mark title strategy as injectable (#46639)
Add the `@Injectable` decorator in the title strategy example so that it can be injected in the providers of the routing module.
PR Close #46639
2022-06-30 12:43:32 -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
Bezael 07d12055e6 docs: add bezael to GDE resources (#46412)
PR Close #46412
2022-06-28 13:02:25 -07:00
Dylan Hunn f6a096e3d4 fix(forms): Update a Forms validator error to use RuntimeError (#46537)
Replace `new Error()` in a forms Validators function with `RuntimeError`, for better tree-shakability. Also, improve the error messages, and add documentation.

PR Close #46537
2022-06-28 11:32:54 -07:00
Jessica Janiuk f86e0948f8 fix(core): Updates error to use RuntimeError code (#46526)
This updates the iterable differ error to use more up-to-date error
codes.

PR Close #46526
2022-06-28 00:29:54 -07:00
Alan Agius 21cce3a82b docs: add how to pass array options to the CLI (#46505)
With this change we add an example on how to use array options in the CLI.

Closes #33851

PR Close #46505
2022-06-27 10:56:30 -07:00
Alan Agius d5717612a5 docs: update CLI command-language syntax (#46505)
Remove reference to camel case options and arguments as this is no longer valid in version 14.

Also, wrap required arguments with `<>` as this is correct syntax to differentiate between optional and required args.

PR Close #46505
2022-06-27 10:56:29 -07:00
dario-piotrowicz 7558c558e0 feat(docs-infra): redesign contributors page (#46347)
redesign the aio contributors page so that it displays the contributors
details as a list instead of using flipping cards, this should improve
the usability of the page and especially its accessibility

resolves #44346

PR Close #46347
2022-06-24 13:11:56 -07:00
Aristeidis Bampakos fac6944ff7 docs: fix typos in several guides (#46453)
PR Close #46453
2022-06-22 09:14:53 -07:00
Dany Paredes 2512f65e51 docs: add dany paredes to GDE resources (#46411)
PR Close #46411
2022-06-21 14:21:29 -07:00
web-dave 96c70741ab docs: update ng-de date (#46446)
PR Close #46446
2022-06-21 11:49:09 -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
dario-piotrowicz ba4f3aabee docs: add standalone details to NG0302 (#46090)
improve the error information of NG0302 by including details about
standalone pipes (and components)

PR Close #46090
2022-06-15 14:04:14 -07:00
piyush132000 9ce733aacb docs: fix code style (#45527)
I have removed unnecessary code from the components & i initialize the
form in OnInit function (life cycle). I think initilization of forms and
getting data from service must be done inside ngOnInit.

PR Close #45527
2022-06-14 19:56:49 +00:00
Badawi7 1278d2af6a docs: fix multicast observable example output (#46127)
Fix the order of logs that represent the output of the multicasting example, as the correct behavior is that all observers are notified of the final value before any of them is notified about completion.
PR Close #46127
2022-06-14 17:04:12 +00:00
vivekkoya 86303f73c9 docs(core): fix broken link <BLANK LINE> Dead link is updated with new, working, and updated link. (#46359)
PR Close #46359
2022-06-14 15:55:19 +00: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