Commit graph

111 commits

Author SHA1 Message Date
loka shafeek
835c3a1c27 docs: Update wildcard route component to PageNotFoundComponent (#54570)
This PR enhances the Angular documentation by replacing the placeholder `<component-name>` with the actual `PageNotFoundComponent` in the wildcard route configuration. This update ensures that the documentation accurately reflects the recommended practice for handling page-not-found scenarios. Additionally, it addresses the issue where HTML entities like `&lt;` were being displayed instead of the desired `<` symbol, resulting in clearer and more readable documentation for users.
PR Close #54570
2024-02-23 11:45:38 -08:00
Thabo
32d0742348 docs: fix typo in router.md (#54194)
Correct spelling mistake

PR Close #54194
2024-02-01 22:31:48 +00:00
Alan Agius
3598d212a6 docs: update to standalone and routing by default (#52293)
This commit covers several changes:
 - routing enabled by default
 - standalone by default

PR Close #52293
2023-10-25 16:37:52 -07:00
Paul Gschwendtner
05762b9fff refactor(localize): ignore code duplication error with compiler package (#51500) (#51558)
The localize package intentionally duplicates some logic from the
compiler to avoid adding a dependency. This is now an error in the
packaging rule to prevent common pitfalls/code duplication. Here it's
an explicit decision though so we mark it as such and ask for the check
to be ignored for the particular import.

PR Close #51500

PR Close #51558
2023-09-08 14:49:07 -07:00
Matthieu Riegler
0623158505 docs: add mention of paramsInheritanceStrategy in the router doc (#51051)
`paramsInheritanceStrategy` might be usefull in combination of `withComponentInputBinding`.

PR Close #51051
2023-07-17 21:02:14 +00:00
Arno Chauveau
915abc6f35 docs(router): correct references to guard services (#50514)
PR Close #50514
2023-05-31 12:37:19 -07:00
Matthieu Riegler
661b9549c2 docs: schematics for functional guards & resolvers (#49865)
Adding back the schematics to generate functional guards & resolver that they are supported.

PR Close #49865
2023-04-19 16:22:53 +00:00
Andrew Scott
81c9dd731c docs(router): Update common tasks guide to use input binding instead of ActivatedRoute (#49633)
The easiest way to access route data is now to use direct bindings to
component inputs rather than going through `ActivatedRoute`.

The tour of heroes guide still uses `ActivatedRoute` for now. I was
hesitant to remove all of the content in one swoop and the tour of
heroes is quite a bit more involved.

PR Close #49633
2023-03-30 16:10:54 -07:00
Stephanie Tuerk
66f7519547 docs: clarify ActivatedRouter injection location (#49270)
The example in the code snippet below this line of text shows `ActivatedRouter` being injected into a component's constructor. When I read instruction to inject A`ActivatedRouter` into **application's** constructor, I assumed this meant the constructor for `app.component.ts`. 

Editing to clarify/match code example below.
PR Close #49270
2023-02-28 17:13:36 -08:00
Andrew Scott
ee13ab2b93 docs(router): Update router docs to use guard functions instead of @Injectable (#47989)
This commit updates various router docs to use the functional style
guards instead of the `@Injectable` style.

PR Close #47989
2022-11-08 11:35:08 -08:00
Dmytro Mezhenskyi
4ba2d3d6b6 docs: add missing link to canMatch guard (#47602)
PR Close #47602
2022-10-03 08:47:27 -07:00
ileil
0920a15139 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:13 -07:00
Durairaj Subramaniam
2123317d02 docs: fix link in routing (#46988)
PR Close #46988
2022-08-01 13:00:24 -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
Andrew Scott
e4538e03d6 refactor(docs-infra): Redirect old document title guide to new router feature (#45857)
The "set-document-title" guide was in place to direct developers to the
`Title` service for managing page titles. Managing the title is now
available in the `Router` package and is much easier. This change
deletes the old guide and redirects it to the section in the router
guide about setting the page title.

PR Close #45857
2022-05-04 16:30:52 -07:00
Marko Kaznovac
ec5cb0bb54 docs: use language agnostic mdn urls (#45666)
PR Close #45666
2022-04-18 14:10:16 -07:00
Marko Kaznovac
3477364852 docs: fix mdn links (#45666)
PR Close #45666
2022-04-18 14:10:16 -07:00
Joe Martin (Crowdstaffing)
42289f25c6 docs: improve markdown (#45325)
The purpose of the changes is to clean all markdown to match a single pedantic style.

*   To ensure all changes in style are properly separated.
*   To ensure all styled content aligns to nearest 4-character-tab.
*   To ensure all code blocks use the Angular `<code-example>` or `<code-tab>` elements.
*   To ensure all markdown exists outside of html tags.
*   To ensure all images use the Angular style for `<img>` elements.
*   To ensure that all smart punctuation is replaced or removed.

    ```text
    ’, ’, “, ”, –, —, …
    ```

*   To ensure all content does not conflict with the following reserved characters.

    ```text
    @, $, *, &, #, |, <, >,
    ```

*   To ensure all content displays using html entities.

The following changes were made to files in the following directory.

```text
aio/content
```

The target files were markdown files.
The list of excluded files:

```text
.browserslistrc, .css, .conf, .editorconfig, .gitignore, .html, .js, .json, .sh, .svg, .ts, .txt, .xlf,
```

PR Close #45325
2022-04-08 19:36:30 +00:00
Andrew Scott
910de8bc33 feat(router): Add Route.title with a configurable TitleStrategy (#43307)
This commit provides a service, `PageTitleStrategy` for setting
the document page title after a successful router navigation.

Users can provide custom strategies by extending `TitleStrategy` and
adding a provider which overrides it.

The strategy takes advantage of the pre-existing `data` and `resolve` concepts
in the Router implementation:

We can copy the `Route.title` into `data`/`resolve` in a
non-breaking way by using a `symbol` as the key. This ensures that we
do not have any collisions with pre-existing property names. By using
`data` and `resolve`, we do not have to add anything more to
the router navigation pipeline to support this feature.

resolves #7630

PR Close #43307
2022-01-27 22:02:33 +00:00
faso-dev
12f7c85fd0 docs: fix typo (#44427)
`name` instead of `id`
PR Close #44427
2021-12-14 16:07:22 -05:00
Teri Glover
bba683bb68 docs: Edits to remove jargon (#42918)
PR Close #42918
2021-09-20 22:50:15 +00:00
Mwiku
928e1e2275 docs: describe your change... (#43455)
Use the --defaults option when creating the application to make CSS the default styling processor.
PR Close #43455
2021-09-17 17:54:24 +00:00
Kapunahele Wong
e299683692 docs: improve accessibility of router example (#40914)
PR Close #40914
2021-06-10 10:28:33 -07:00
Alex
0ac193c86c docs: fix typo in the Router guide (#42455)
PR Close #42455
2021-06-02 13:24:30 -07:00
David Shevitz
1040697787 docs: remove sentence about how the not reloading the page. (#42290)
Fixes #41889

PR Close #42290
2021-05-24 15:42:42 -07:00
Teri Glover
d2a89dbbd9 docs: edits to remove jargon (#41282)
PR Close #41282
2021-05-20 23:06:02 +00:00
Teri Glover
57540f0e75 docs: edit to remove jargon (#41282)
PR Close #41282
2021-05-20 23:06:02 +00:00
David Shevitz
5b9a36cf95 docs: move all existing router documentation into a single location and add two new topics: an overview and a reference (#41972)
PR Close #41972
2021-05-18 15:39:38 -07:00
Pete Bacon Darwin
3a48c0739d build(docs-infra): ensure that terminal code snippets render correctly (#41986)
After the changes to the `lang-none` styling in #41335, code snippets marked with

```
language="none" class="code-shell"
```

were being styled with the same foreground and background colours.

It turns out that most of these ought to be marked `language="sh"`
in which case the `code-shell` style became redundant and has been
removed.

Fixes #41984

PR Close #41986
2021-05-07 13:11:04 -04:00
Daniel
5eab6e14f1 docs: fix typo in router.md file (#41064)
PR Close #41064
2021-03-03 09:36:06 -08:00
Alexey Elin
7a8821c9aa docs: add link to component-less routes description. (#40741)
Currently it's not clear what a component-less route is. Add a link to  make it clear

PR Close #40741
2021-02-10 11:08:39 -08:00
George Kalpakas
a086976d68 fix(docs-infra): improve heading styles (#40427)
This commit includes some general improvements to heading styles
(font-weight, margin/padding). It also adds a horizontal separator above
`<h2>` headings to segment important sections more easily.
(As a consequence, we can remove several `<hr />` elements right before
`<h2>` headings.)

Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40427
2021-02-02 12:04:55 -08:00
Gillan Martindale
6ff28ac944 docs: Remove redundant sentence from Router (#38398)
PR Close #38398
2020-08-10 09:52:30 -07:00
George Kalpakas
5303773daf refactor(docs-infra): fix docs examples for tslint rule prefer-const (#38143)
This commit updates the docs examples to be compatible with the
`prefer-const` tslint rule.

This is in preparation of updating the docs examples `tslint.json` to
match the one generated for new Angular CLI apps in a future commit.

PR Close #38143
2020-07-31 11:00:06 -07:00
Andrew Scott
8effc83b92 docs(router): clarify how base href is used to construct targets (#38123)
The documentation is not clear on how the base href and APP_BASE_HREF are used. This commit
should help clarify more complicated use-cases beyond the most common one of just a '/'

PR Close #38123
2020-07-29 13:34:02 -07:00
Kapunahele Wong
5b31a0a294 docs: separate template syntax into multiple docs (#36954)
This is part of a re-factor of template syntax and
structure. The first phase breaks out template syntax
into multiple documents. The second phase will be
a rewrite of each doc.

Specifically, this PR does the following:

- Breaks sections of the current template syntax document each into their own page.
- Corrects the links to and from these new pages.
- Adds template syntax subsection to the left side NAV which contains all the new pages.
- Adds the new files to pullapprove.

PR Close #36954
2020-07-20 11:16:44 -07:00
RN Lee
4ec3026a9a docs(router): fix typo in https://angular.io/guide/router#activated-route (#38034)
In angular.io, it linked to the wrong part of the page. https://angular.io/guide/router#activated-route

PR Close #38034
2020-07-14 09:10:26 -07:00
David Shevitz 🔵
88d68d2d21 docs: Move router tutorial (toh) from router.md to new file (#37979)
In an effort to make angular documentation easier for users to read,
we are moving the router tutorial currently in router.md to a new file.
To support this change, we have done the following:

* Update files to fix any broken links caused by moving the file
* Updated the new file to follow tutorial guidelines
* Add the new file to the table of  contents under, Tutorials.

PR Close #37979
2020-07-10 15:04:55 -07:00
Kapunahele Wong
2c5e873da0 docs: move lazy loading and preloading tasks from router to lazy loading doc (#36748)
After rewriting much of the router doc, it became apparent that the lazy loading/preloading information should be in the lazy loading doc rather than in the router doc. There is now instead a short section that touches on lazy loading but links to the lazy learning document instead of covering it in detail in the router doc.

PR Close #36748
2020-05-15 10:01:52 -07:00
Andrew Scott
8a56c99f87 docs(router): Update router guide to use UrlTree for guard redirects (#37100)
The current implementation for redirecting users inside guards was in place
before the feature was added to allow `CanActivate` and `CanActivateChild` guards
to return `UrlTree` for redirecting users.

Returning `UrlTree` should be the default method, as it provides a more desirable
redirecting experience. When using `router.navigate` followed by `return false`,
the `Router` calls `resetUrlToCurrentUrlTree` (in the `finalize` operator) before
processing the navigation to the new route.  This can result in an undesirable
history if the navigation was the first navigation in the application - that is,
the route will briefly be reset to just `/` (see #36187).

Fixes #36187

PR Close #37100
2020-05-14 12:23:35 -07:00
Sonu Kapoor
2cddeabce0 docs: fixes ngOnit routing variable (#36905)
This commit fixes the routing variable in the `ngOnit` life-cyle event from
`activatedRoute` to `route`.

Closes #36885

PR Close #36905
2020-05-12 14:40:24 -07:00
Martin Sikora
d9c4840a9c fix(router): cancel navigation when at least one resolver completes with no "next" emission (#24621)
This change aligns behavior for resolvers which return EMPTY. Currently EMPTY resolvers have inconsistent behavior:
- One resolver that returns EMPTY => won't navigate and just ends on ResolveStart router event.
- Two resolvers where both return EMPTY => throws "Error: Uncaught (in promise): EmptyError: no elements in sequence"
- Two resolvers where one returns a value and the other one returns EMPTY => Navigates successfully.
With this change any EMPTY resolver will cancel navigation.

BREAKING CHANGE: Any resolver which return EMPTY will cancel navigation.
If you want to allow the navigation to continue, you will need to update the resolvers to emit
some value, (i.e. defaultIfEmpty(...), of(...), etc).
PR Close #24195

PR Close #24621
2020-05-04 12:36:49 -07:00
Grant Fleming
cae2a893f2 docs: fix typo (#36786)
Correct typo in the router docs, changing "as your app growns" to "as your app grows". Previously the wrong spelling was used and this commit rectifies this.

PR Close #36786
2020-04-27 12:50:42 -07:00
Judy Bogart
75dff8a93a docs: improve startup nav, naming, and terminology (#35533)
PR Close #35533
2020-04-22 17:08:29 -04:00
Kapunahele Wong
305b059809 docs: refactor routing doc (#35566)
This rewrite changes headings to focus on user tasks rather than features,
verifies that content is up-to-date and complete, removes colloquial phrases,
adds prerequisites, and expands on a task-based section in the beginning
(a quick reference).

PR Close #35566
2020-04-16 10:36:01 -07:00
Judy Bogart
e1ac2efe4a docs: make page titles and toc task-oriented (#36024)
PR Close #36024
2020-04-01 13:16:48 -07:00
Sonu Kapoor
a7d5c55926 docs: fix routing code to use navigate (#35176)
Previously, the example in the `router` guide was not
preserving the query params after logging in.

This commit fixes this by using `navigate` instead of
using `navigateByUrl`, which ignores any properties in
the `NavigationExtras` that would change the provided URL.

Fixes 34917

PR Close #35176
2020-02-24 09:00:03 -08:00
Aravind
1be5b69174 docs: fix typo on router guide (#34911)
closes #34907
PR Close #34911
2020-01-22 14:32:56 -08:00
Judy Bogart
efdf347f9c docs: apply standard header case convention (#34196)
PR Close #34196
2020-01-10 08:38:53 -08:00
Kapunahele Wong
d655093123 docs: add Animations import in Router doc (#33740)
Fixes #33665

PR Close #33740
2019-11-25 22:37:55 -05:00