Skip to content

Commit 3598d21

Browse files
alan-agius4dylhunn
authored andcommitted
docs: update to standalone and routing by default (angular#52293)
This commit covers several changes: - routing enabled by default - standalone by default PR Close angular#52293
1 parent 30ae5be commit 3598d21

11 files changed

+45
-44
lines changed

aio/content/guide/angular-compiler-options.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ The `module` field of the library's `package.json` would be `"index.js"` and the
138138
When `true`, the recommended value, enables the [binding expression validation](guide/aot-compiler#binding-expression-validation) phase of the template compiler. This phase uses TypeScript to verify binding expressions.
139139
For more information, see [Template type checking](guide/template-typecheck).
140140

141-
Default is `false`, but when you use the Angular CLI command `ng new --strict`, it is set to `true` in the new project's configuration.
141+
Default is `false`, but set to `true` in the created workspace configuration when creating a project using the Angular CLI.
142142

143143
<div class="alert is-important">
144144

@@ -213,7 +213,7 @@ When `true`, reports an error for a supplied parameter whose injection type cann
213213
When `false`, constructor parameters of classes marked with `@Injectable` whose type cannot be resolved produce a warning.
214214
The recommended value is `true`, but the default value is `false`.
215215

216-
When you use the Angular CLI command `ng new --strict`, it is set to `true` in the created project's configuration.
216+
Set to `true` in the created workspace configuration when creating a project using the Angular CLI.
217217

218218
### `strictTemplates`
219219

@@ -222,7 +222,7 @@ When `true`, enables [strict template type checking](guide/template-typecheck#st
222222
The strictness flags that this option enables allow you to turn on and off specific types of strict template type checking.
223223
See [troubleshooting template errors](guide/template-typecheck#troubleshooting-template-errors).
224224

225-
When you use the Angular CLI command `ng new --strict`, it is set to `true` in the new project's configuration.
225+
Set to `true` in the created workspace configuration when creating a project using the Angular CLI.
226226

227227
### `trace`
228228

@@ -246,4 +246,4 @@ Besides the configuration file, you can also use [`tsc` command line options](ht
246246

247247
<!-- end links -->
248248

249-
@reviewed 2023-04-19
249+
@reviewed 2023-10-24

aio/content/guide/file-structure.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ Angular components, templates, and styles go here.
9292

9393
| `src/app/` files | Purpose |
9494
|---|---|
95-
| `app/app.config.ts` | Defines the application config logic that tells Angular how to assemble the application. As you add more providers to the app, they must be declared here.<br><br>_Only generated when using the `--standalone` option._ |
95+
| `app/app.config.ts` | Defines the application config logic that tells Angular how to assemble the application. As you add more providers to the app, they must be declared here. |
9696
| `app/app.component.ts` | Defines the logic for the application's root component, named `AppComponent`. The view associated with this root component becomes the root of the [view hierarchy](guide/glossary#view-hierarchy) as you add components and services to your application. |
9797
| `app/app.component.html` | Defines the HTML template associated with the root `AppComponent`. |
9898
| `app/app.component.css` | Defines the base CSS stylesheet for the root `AppComponent`. |
9999
| `app/app.component.spec.ts` | Defines a unit test for the root `AppComponent`. |
100-
| `app/app.module.ts` | Defines the root module, named `AppModule`, that tells Angular how to assemble the application. Initially declares only the `AppComponent`. As you add more components to the app, they must be declared here.<br><br>_This file is not generated when using the `--standalone` option._ |
100+
| `app/app.module.ts` | Defines the root module, named `AppModule`, that tells Angular how to assemble the application. Initially declares only the `AppComponent`. As you add more components to the app, they must be declared here.<br><br>_This file is not generated when using `--no-standalone` option._ |
101101

102102
### Application configuration files
103103

@@ -207,4 +207,4 @@ Under the `projects/` folder, the `my-lib` folder contains your library code.
207207

208208
<!-- end links -->
209209

210-
@reviewed 2023-04-24
210+
@reviewed 2023-10-24

aio/content/guide/lazy-loading-ngmodules.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ Enter the following command where `customer-app` is the name of your app:
6868

6969
<code-example format="shell" language="shell">
7070

71-
ng new customer-app --routing
71+
ng new customer-app --no-standalone
7272

7373
</code-example>
7474

75-
This creates an application called `customer-app` and the `--routing` flag generates a file called `app-routing.module.ts`. This is one of the files you need for setting up lazy loading for your feature module.
75+
This creates an application called `customer-app` with a file called `app-routing.module.ts`. This is one of the files you need for setting up lazy loading for your feature module.
7676
Navigate into the project by issuing the command `cd customer-app`.
7777

7878
### Create a feature module with routing
@@ -422,4 +422,4 @@ You might also be interested in the following:
422422

423423
<!-- end links -->
424424

425-
@reviewed 2022-05-07
425+
@reviewed 2023-10-24

aio/content/guide/router-tutorial.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ This application will have two components: *crisis-list* and *heroes-list*.
4343

4444
<code-example format="shell" language="shell">
4545

46-
ng new angular-router-sample --standalone
46+
ng new angular-router-sample
4747

4848
</code-example>
4949

@@ -58,7 +58,7 @@ This application will have two components: *crisis-list* and *heroes-list*.
5858

5959
<code-example format="shell" language="shell">
6060

61-
ng generate component crisis-list --standalone
61+
ng generate component crisis-list
6262

6363
</code-example>
6464

@@ -70,7 +70,7 @@ This application will have two components: *crisis-list* and *heroes-list*.
7070

7171
<code-example format="shell" language="shell">
7272

73-
ng generate component heroes-list --standalone
73+
ng generate component heroes-list
7474

7575
</code-example>
7676

@@ -130,7 +130,7 @@ To add this functionality to your sample application, you need to update the `ap
130130
You import this provider function from `@angular/router`.
131131

132132
1. From your code editor, open the `app.config.ts` file.
133-
1. Add the following import statements:
133+
1. Add the following import statements:
134134

135135
```
136136
import { provideRouter } from '@angular/router';
@@ -263,7 +263,7 @@ In this section, you'll create a 404 page and update your route configuration to
263263

264264
<code-example format="shell" language="shell">
265265

266-
ng generate component page-not-found --standalone
266+
ng generate component page-not-found
267267

268268
</code-example>
269269

@@ -308,4 +308,4 @@ For more information about routing, see the following topics:
308308

309309
<!-- end links -->
310310

311-
@reviewed 2022-02-28
311+
@reviewed 2023-10-24

aio/content/guide/router.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ This topic describes how to implement many of the common tasks associated with a
44

55
<a id="basics"></a>
66

7-
## Generate an application with routing enabled
7+
## Generate an application
88

99
The following command uses the Angular CLI to generate a basic Angular application with application routes.
1010
The application name in the following example is `routing-app`.
1111

1212
<code-example format="shell" language="shell">
1313

14-
ng new routing-app --routing --defaults --standalone
14+
ng new routing-app
1515

1616
</code-example>
1717

@@ -22,7 +22,7 @@ To create a component using the CLI, enter the following at the command line whe
2222

2323
<code-example format="shell" language="shell">
2424

25-
ng generate component first --standalone
25+
ng generate component first
2626

2727
</code-example>
2828

@@ -31,7 +31,7 @@ Here, the new name is `second`.
3131

3232
<code-example format="shell" language="shell">
3333

34-
ng generate component second --standalone
34+
ng generate component second
3535

3636
</code-example>
3737

@@ -66,15 +66,15 @@ Import the routes into `app.config.ts` and add it to the `provideRouter` functio
6666

6767
The Angular CLI performs this step for you.
6868
However, if you are creating an application manually or working with an existing, non-CLI application, verify that the imports and configuration are correct.
69-
The following is the default `ApplicationConfig` using the CLI with the `--routing` flag.
69+
The following is the default `ApplicationConfig` using the CLI.
7070

7171
```
7272
export const appConfig: ApplicationConfig = {
7373
providers: [provideRouter(routes)]
7474
};
7575
```
7676

77-
1. Set up a `Routes` array for your routes
77+
1. Set up a `Routes` array for your routes
7878

7979
The Angular CLI performs this step automatically.
8080

@@ -725,4 +725,4 @@ When using `RouterModule.forRoot`, this is configured with the `useHash: true` i
725725

726726
<!-- end links -->
727727

728-
@reviewed 2023-08-29
728+
@reviewed 2023-10-24

aio/content/guide/routing-with-urlmatcher.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ In addition to the default Angular application framework, you will also create a
3333

3434
<code-example format="shell" language="shell">
3535

36-
ng new angular-custom-route-match --standalone
36+
ng new angular-custom-route-match
3737

3838
</code-example>
3939

@@ -48,7 +48,7 @@ In addition to the default Angular application framework, you will also create a
4848

4949
<code-example format="shell" language="shell">
5050

51-
ng generate component profile --standalone
51+
ng generate component profile
5252

5353
</code-example>
5454

@@ -146,4 +146,4 @@ This content is based on [Custom Route Matching with the Angular Router](https:/
146146
147147
<!-- end links -->
148148
149-
@reviewed 2022-02-28
149+
@reviewed 2023-10-24

aio/content/guide/workspace-config.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ The schemas configure options for the following builders.
135135

136136
<!-- vale Angular.Google_WordListWarnings = NO -->
137137

138+
* [application](https://github.com/angular/angular-cli/blob/main/packages/angular_devkit/build_angular/src/builders/application/schema.json)
138139
* [app-shell](https://github.com/angular/angular-cli/blob/main/packages/angular_devkit/build_angular/src/builders/app-shell/schema.json)
139140
* [browser](https://github.com/angular/angular-cli/blob/main/packages/angular_devkit/build_angular/src/builders/browser/schema.json)
140141
* [dev-server](https://github.com/angular/angular-cli/blob/main/packages/angular_devkit/build_angular/src/builders/dev-server/schema.json)
@@ -198,7 +199,7 @@ It has the following top-level properties.
198199

199200
| PROPERTY | Details |
200201
|:--- |:--- |
201-
| `builder` | The npm package for the build tool used to create this target. The default builder for an application \(`ng build myApp`\) is `@angular-devkit/build-angular:browser`, which uses the [webpack](https://webpack.js.org) package bundler. <div class="alert is-helpful"> **NOTE**: A different builder is used for building a library \(`ng build myLib`\). </div> |
202+
| `builder` | The npm package for the build tool used to create this target. The default builder for an application \(`ng build myApp`\) is `@angular-devkit/build-angular:application`, which uses the [esbuild](https://esbuild.github.io/) package bundler. <div class="alert is-helpful"> **NOTE**: A different builder is used for building a library \(`ng build myLib`\). </div> |
202203
| `options` | This section contains default build target options, used when no named alternative configuration is specified. See the [Default build targets](#default-build-targets) section. |
203204
| `configurations`| This section defines and names alternative configurations for different intended destinations. It contains a section for each named configuration, which sets the default options for that intended environment. See the [Alternate build configurations](#build-configs) section. |
204205

@@ -547,4 +548,4 @@ When supplying the value as a String the filename of the specified path will be
547548

548549
<!-- end links -->
549550

550-
@reviewed 2022-02-28
551+
@reviewed 2023-10-24

aio/content/tutorial/first-app/first-app-lesson-01.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ In the **Terminal** pane of your IDE:
2020

2121
1. In your project directory, navigate to the `first-app` directory.
2222
1. Run this command to install the dependencies needed to run the app.
23-
23+
2424
<code-example format="shell" language="shell">
2525

2626
npm install
@@ -120,4 +120,4 @@ For more information about the topics covered in this lesson, visit:
120120
* [Angular Components](/guide/component-overview)
121121
* [Creating applications with the Angular CLI](/cli)
122122

123-
@reviewed 2023-07-10
123+
@reviewed 2023-10-24

aio/content/tutorial/first-app/first-app-lesson-02.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ In the **Terminal** pane of your IDE:
3939

4040
<code-example format="shell" language="shell">
4141

42-
ng generate component home --standalone --inline-template --skip-tests
42+
ng generate component home --inline-template --skip-tests
4343

4444
</code-example>
4545

@@ -132,4 +132,4 @@ For more information about the topics covered in this lesson, visit:
132132
* [`Component` reference](api/core/Component)
133133
* [Angular components overview](guide/component-overview)
134134

135-
@reviewed 2023-07-10
135+
@reviewed 2023-10-24

aio/content/tutorial/first-app/first-app-lesson-03.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ In the **Terminal** pane of your IDE:
2222
1. Run this command to create a new `HousingLocationComponent`
2323

2424
<code-example format="shell" language="shell">
25-
ng generate component housingLocation --standalone --inline-template --skip-tests
25+
ng generate component housingLocation --inline-template --skip-tests
2626
</code-example>
2727

2828
1. Run this command to build and serve your app.
@@ -64,7 +64,7 @@ In the **Edit** pane of your IDE:
6464
In this step, you will copy over the pre-written styles for the `HousingLocationComponent` to your app so that the app renders properly.
6565

6666
1. Open `src/app/housing-location/housing-location.css`, and paste the styles below into the file:
67-
67+
6868
<code-example header="Add CSS styles to housing location to the component in src/app/housing-location/housing-location.component.css" path="first-app-lesson-03/src/app/housing-location/housing-location.component.css"></code-example>
6969

7070
1. Save your code, return to the browser and confirm that the app builds without error. You should find the message "housing-location works!" rendered to the screen.Correct any errors before you continue to the next step.
@@ -84,4 +84,4 @@ If you are having any trouble with this lesson, you can review the completed cod
8484

8585
* [First Angular app lesson 4 - Add a housing location interface to the application](tutorial/first-app/first-app-lesson-04)
8686

87-
@reviewed 2023-07-11
87+
@reviewed 2023-10-24

0 commit comments

Comments
 (0)