You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: adev/src/content/guide/routing/router-reference.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ The in-application URLs can be indistinguishable from server URLs.
56
56
Modern HTML5 browsers were the first to support `pushState` which is why many people refer to these URLs as "HTML5 style" URLs.
57
57
58
58
HELPFUL: HTML5 style navigation is the router default.
59
-
In the [LocationStrategy and browser URL styles](#locationstrategy-and-browser-url-styles) section, learn why HTML5 style is preferable, how to adjust its behavior, and how to switch to the older hash \(`#`\) style, if necessary.
59
+
In the [LocationStrategy and browser URL styles](common-router-tasks#locationstrategy-and-browser-url-styles) section, learn why HTML5 style is preferable, how to adjust its behavior, and how to switch to the older hash \(`#`\) style, if necessary.
60
60
61
61
You must add a [`<base href>` element](https://developer.mozilla.org/docs/Web/HTML/Element/base'base href') to the application's `index.html` for `pushState` routing to work.
62
62
The browser uses the `<base href>` value to prefix relative URLs when referencing CSS files, scripts, and images.
@@ -94,7 +94,6 @@ Those developers can still use HTML5 URLs by taking the following two steps:
94
94
95
95
1. Provide the router with an appropriate `APP_BASE_HREF` value.
96
96
1. Use root URLs \(URLs with an `authority`\) for all web resources: CSS, images, scripts, and template HTML files.
97
-
98
97
- The `<base href>``path` should end with a "/", as browsers ignore characters in the `path` that follow the right-most "`/`"
99
98
- If the `<base href>` includes a `query` part, the `query` is only used if the `path` of a link in the page is empty and has no `query`.
100
99
This means that a `query` in the `<base href>` is only included when using `HashLocationStrategy`.
| body contents |`string`| nested tabs of `docs-code` examples |
205
+
|`path`|`string`| Path to code example for preview and external link |
206
+
|`preview`|`boolean`| (False) display preview |
207
+
|`hideCode`|`boolean`| (False) Whether to collapse code example by default. |
208
208
209
209
### Adding `preview` to your code example
210
210
211
211
Adding the `preview` flag builds a running example of the code below the code snippet. This also automatically adds a button to open the running example in Stackblitz.
212
212
213
213
NOTE: `preview` only works with standalone.
214
214
215
-
### Styling example previews with Tailwind CSS
215
+
### Styling example previews with Tailwind CSS
216
216
217
217
Tailwind utility classes can be used within code examples.
|`<docs-workflow>`| All steps must be nested inside a workflow |
235
+
|`title`| Step title |
236
+
| step body contents | Anything between `<docs-step>` and `</docs-step>`|
237
237
238
238
Steps must start on a new line, and can contain `docs-code`s and other nested elements and styles.
239
239
@@ -242,7 +242,7 @@ Steps must start on a new line, and can contain `docs-code`s and other nested el
242
242
<docs-steptitle="Install the Angular CLI">
243
243
You use the Angular CLI to create projects, generate application and library code, and perform a variety of ongoing development tasks such as testing, bundling, and deployment.
244
244
245
-
To install the Angular CLI, open a terminal window and run the following command:
245
+
To install the Angular CLI, open a terminal window and run the following command:
246
246
247
247
<docs-codelanguage="shell">
248
248
npm install -g @angular/cli
@@ -252,34 +252,34 @@ Steps must start on a new line, and can contain `docs-code`s and other nested el
252
252
<docs-steptitle="Create a workspace and initial application">
253
253
You develop apps in the context of an Angular workspace.
254
254
255
-
To create a new workspace and initial starter app:
255
+
To create a new workspace and initial starter app:
256
256
257
-
* Run the CLI command `ng new` and provide the name `my-app`, as shown here:
258
-
<docs-codelanguage="shell">
259
-
ng new my-app
260
-
</docs-code>
257
+
- Run the CLI command `ng new` and provide the name `my-app`, as shown here:
258
+
<docs-codelanguage="shell">
259
+
ng new my-app
260
+
</docs-code>
261
261
262
-
* The ng new command prompts you for information about features to include in the initial app. Accept the defaults by pressing the Enter or Return key.
262
+
- The ng new command prompts you for information about features to include in the initial app. Accept the defaults by pressing the Enter or Return key.
263
263
264
264
The Angular CLI installs the necessary Angular npm packages and other dependencies. This can take a few minutes.
265
265
266
266
The CLI creates a new workspace and a simple Welcome app, ready to run.
267
-
</docs-step>
267
+
</docs-step>
268
268
269
269
<docs-steptitle="Run the application">
270
270
The Angular CLI includes a server, for you to build and serve your app locally.
271
271
272
-
1. Navigate to the workspace folder, such as `my-app`.
273
-
2. Run the following command:
274
-
<docs-codelanguage="shell">
275
-
cd my-app
276
-
ng serve --open
277
-
</docs-code>
272
+
1. Navigate to the workspace folder, such as `my-app`.
273
+
2. Run the following command:
274
+
<docs-codelanguage="shell">
275
+
cd my-app
276
+
ng serve --open
277
+
</docs-code>
278
278
279
-
The `ng serve` command launches the server, watches your files, and rebuilds the app as you make changes to those files.
279
+
The `ng serve` command launches the server, watches your files, and rebuilds the app as you make changes to those files.
280
280
281
-
The `--open` (or just `-o`) option automatically opens your browser to <http://localhost:4200/>.
282
-
If your installation and setup was successful, you should see a page similar to the following.
281
+
The `--open` (or just `-o`) option automatically opens your browser to <http://localhost:4200/>.
282
+
If your installation and setup was successful, you should see a page similar to the following.
283
283
</docs-step>
284
284
285
285
<docs-steptitle="Final step">
@@ -299,7 +299,7 @@ Steps must start on a new line, and can contain `docs-code`s and other nested el
299
299
300
300
You can add images using the semantic Markdown image:
301
301
302
-

302
+

303
303
304
304
### Add `#small` and `#medium` to change the image size
305
305
@@ -339,7 +339,7 @@ Write diagrams and charts using [Mermaid](http://mermaid.js.org/) by setting the
339
339
340
340
## Horizontal Line Divider
341
341
342
-
This can be used to separate page sections, like we're about to do below. These styles will be added by default, nothing custom needed.
342
+
This can be used to separate page sections, like we're about to do below. These styles will be added by default, nothing custom needed.
0 commit comments