1
0
mirror of https://github.com/angular/angular-cli.git synced 2025-05-20 21:42:38 +08:00

20 Commits

Author SHA1 Message Date
ced
5ceedcb11e feat(@schematics/angular): remove deprecated CanLoad option for guards
Angular v15.1 deprecated the `CanLoad` guard in favor of `CanMatch`.
This commit removes the support for `CanLoad` when generating a guard with the CLI, to encourage developers to use `CanMatch` instead.

BREAKING CHANGE:
The CLI no longer allows to generate `CanLoad` guards. Use `CanMatch` instead.
2023-02-15 21:03:02 +00:00
Andrew Scott
b34c719769 fixup! feat(@schematics/angular): Add schematics for generating functional router guards and resolvers 2022-11-09 09:34:07 +01:00
Andrew Scott
6c39a162be feat(@schematics/angular): Add schematics for generating functional router guards and resolvers
Functional guards and resolvers were introduced in the Angular router in v14.2.
This commit adds the ability to generate functional router guards by
specifying `--guardType` instead of `--implements`. These guards are also
accompanied by a test that includes a helper function for executing the
guard in the `TestBed` environment so that any `inject` calls in the
guard will work properly. Functional resolvers are generated by adding
the `--functional` flag.
2022-11-09 09:34:07 +01:00
Andrew Scott
f837f6dab4 fix(@schematics/angular): guard schematics should include all guards (CanMatch)
The `CanMatch` guard was added in v14.1 but not added
to the list of possible interfaces to implement.
This commit adds `CanMatch` to the list of possible
interfaces to implement. It has the same type imports
as the CanLoad interface.
2022-11-02 08:49:38 -07:00
Charles Lyding
2b14ac6924 refactor(@schematics/angular): use a helper function for basic generation schematics
An internal schematics helper rule has been introduced for Angular schematics that only generate a set of project files from a set of templated files. Multiple current generation schematics contained essentially the same code which increased the sustainment burden and made refactoring and improvements more complicated.
2021-07-15 12:54:34 +02:00
Charles Lyding
37a06a7c37 build: format all files
All files are now formatted using the ng-dev tools via prettier.
2021-04-28 16:05:49 -07:00
Billy Lando
30815248a8 fix(@schematics/angular): avoid unuse imports for canLoad guard generation 2021-04-28 14:07:32 +02:00
Joey Perrott
003854257c build: migrate all file header to use Google LLC rather than Google Inc 2021-04-27 08:35:22 +02:00
Alan Agius
bfd63cae65 refactor(@schematics/angular): remove deprecated guard spec option
BREAKING CHANGE
Deprecated guard schematic option `spec` has been removed. Please use `skipTests` instead.
2020-04-22 11:30:41 -07:00
cexbrayat
2fc3fabdde fix(@schematics/angular): add CanDeactivate guard
This generates a generic `CanDeactivate<unknown>` guard.

Fixes 
2019-11-14 11:16:36 -08:00
cexbrayat
78b408f911 fix(@schematics/angular): default interface for guard
Currently, if the user hits `<Enter>` before selecting an interface to implement, the CLI generates a broken guard that implements no interface. With this commit, the CLI forces a choice in interactive mode and generates a `CanActivate` guard by default.
2019-08-16 09:34:46 -07:00
Charles Lyding
3e70f252c5 refactor(@schematics/angular): update guard to use new workspace rules 2019-04-15 11:02:46 -07:00
WilliamKoza
02410e4633 fix(@schematics/angular): respect the flag when we create a guard with schematics 2019-02-13 15:27:34 -08:00
Charles Lyding
91d457af73 refactor(@schematics/angular): remove redundant branchAndMerge rules 2019-02-13 15:21:37 -08:00
Alan Agius
36eba0c9fc refactor: use .template suffix for all schematic files
Currently when using `ivy-ngcc` it will print out a warning

```
Failed to read entry point info from //node_modules/@schematics/angular/workspace/files/package.json with error SyntaxError: Unexpected token < in JSON at position 1121.
```

Fixes 
2019-01-16 10:29:56 -08:00
Unknown
8863bc002a feat(@schematics/angular): Added multiselect guard implements option
Adds support for the guard schematic to use multiselect for which interfaces the guard should implement.

Fixes 
2019-01-15 10:16:25 -08:00
Alan Agius
a12a4e02a4 feat(@schematics/angular): consistent naming of options and arguments that do the same thing
This aligns options that do the same thing:
1) `skipSpecs` and `spec` has been deprecated in favor of `skipTests`.
2) `styleext` has been deprecated in favor of `style` since the latest is two words.

Fixes 
2018-12-11 11:55:54 -08:00
Alan Agius
82f2bda2f5 refactor(@schematics/angular): make interaction with architect targets type safe 2018-09-12 12:37:24 -07:00
Hans
aeb4ff5b29 feat(@schematics/angular): reallow --lint-fix for Angular schematics 2018-07-25 21:27:47 -07:00
Hans Larsen
44086c60ff build: move devkit repo back to angular-cli 2018-06-05 18:50:06 -07:00