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
fix(@schematics/angular): generate resolvers with a dash type separator
To align with the updated style guide, Angular v20 will generate resolvers
with file extension `resolver` type prefixed with a `-` separator instead of
a `.` by default. Projects will automatically use this naming convention.
Projects can however opt-out by setting the `typeSeparator` option to `.`
for the resolver schematic. This can be done as a default in the `angular.json`
or directly on the commandline via `--type-separator=.` when executing `ng generate`.
As an example, `example.resolver.ts` will now be named `example-resolver.ts`.
The TypeScript declaration will continue to contain `Resolver` such as with `ExampleResolver`.
Copy file name to clipboardExpand all lines: packages/schematics/angular/guard/schema.json
+2-1
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,8 @@
62
62
"typeSeparator": {
63
63
"type": "string",
64
64
"default": "-",
65
-
"enum": ["-", "."]
65
+
"enum": ["-", "."],
66
+
"description": "The separator character to use before the type within the generated file's name. For example, if you set the option to `.`, the file will be named `example.guard.ts`."
Copy file name to clipboardExpand all lines: packages/schematics/angular/pipe/schema.json
+2-1
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,8 @@
65
65
"typeSeparator": {
66
66
"type": "string",
67
67
"default": "-",
68
-
"enum": ["-", "."]
68
+
"enum": ["-", "."],
69
+
"description": "The separator character to use before the type within the generated file's name. For example, if you set the option to `.`, the file will be named `example.pipe.ts`."
Copy file name to clipboardExpand all lines: packages/schematics/angular/resolver/class-files/__name@dasherize____typeSeparator__resolver.spec.ts.template
+1-1
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
import { TestBed } from '@angular/core/testing';
2
2
3
-
import { <%= classify(name) %>Resolver } from './<%= dasherize(name) %>.resolver';
Copy file name to clipboardExpand all lines: packages/schematics/angular/resolver/functional-files/__name@dasherize____typeSeparator__resolver.spec.ts.template
+1-1
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
import { TestBed } from '@angular/core/testing';
2
2
import { ResolveFn } from '@angular/router';
3
3
4
-
import { <%= camelize(name) %>Resolver } from './<%= dasherize(name) %>.resolver';
Copy file name to clipboardExpand all lines: packages/schematics/angular/resolver/schema.json
+6
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,12 @@
45
45
"$default": {
46
46
"$source": "projectName"
47
47
}
48
+
},
49
+
"typeSeparator": {
50
+
"type": "string",
51
+
"default": "-",
52
+
"enum": ["-", "."],
53
+
"description": "The separator character to use before the type within the generated file's name. For example, if you set the option to `.`, the file will be named `example.resolver.ts`."
0 commit comments