Skip to content

Commit 97c639a

Browse files
jamesgroatbrandyscarney
authored andcommitted
docs(navigation): fix error with default segment naming (ionic-team#13022)
* docs: fix error re: default segment naming The docs incorrectly state how segments get their default names. See commit ionic-team/ionic-app-scripts@5a97ba5. Add note about name and segment properties needing to be unique. ionic-team/ionic-app-scripts@63c4c7f * fix formatting * fix punctuation
1 parent 83ab421 commit 97c639a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/navigation/ionic-page.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ export interface IonicPageMetadata {
7979
*
8080
* The `@IonicPage` decorator accepts a `DeepLinkMetadataType` object. This object accepts
8181
* the following properties: `name`, `segment`, `defaultHistory`, and `priority`. All of them
82-
* are optional but can be used to create complex navigation links.
82+
* are optional but can be used to create complex navigation links. The `name` and `segment`
83+
* values must be unique.
8384
*
8485
*
8586
* ### Changing Name
@@ -108,9 +109,10 @@ export interface IonicPageMetadata {
108109
* ### Setting URL Path
109110
*
110111
* The `segment` property is used to set the URL to the page. If this property isn't provided, the
111-
* `segment` will use the value of `name`. Since components can be loaded anywhere in the app, the
112-
* `segment` doesn't require a full URL path. When a page becomes the active page, the `segment` is
113-
* appended to the URL.
112+
* `segment` will use the value of source file name without the extension (`'my-page.ts'` results
113+
* in segment name `'my-page'`). Since components can be loaded anywhere in the app, the `segment`
114+
* doesn't require a full URL path. When a page becomes the active page, the `segment` is appended
115+
* to the URL.
114116
*
115117
* The `segment` can be changed to anything and doesn't have to match the `name`. For example, passing
116118
* a value for `name` and `segment`:

0 commit comments

Comments
 (0)