1 | {
|
2 | "$schema": "http://json-schema.org/schema",
|
3 | "id": "SchematicsAngularGuard",
|
4 | "title": "Angular Guard Options Schema",
|
5 | "type": "object",
|
6 | "description": "Generates a new, generic route guard definition in the given or default project.",
|
7 | "properties": {
|
8 | "name": {
|
9 | "type": "string",
|
10 | "description": "The name of the new route guard.",
|
11 | "$default": {
|
12 | "$source": "argv",
|
13 | "index": 0
|
14 | },
|
15 | "x-prompt": "What name would you like to use for the guard?"
|
16 | },
|
17 | "skipTests": {
|
18 | "type": "boolean",
|
19 | "description": "When true, does not create \"spec.ts\" test files for the new guard.",
|
20 | "default": false,
|
21 | "x-user-analytics": 12
|
22 | },
|
23 | "flat": {
|
24 | "type": "boolean",
|
25 | "description": "When true (the default), creates the new files at the top level of the current project.",
|
26 | "default": true
|
27 | },
|
28 | "path": {
|
29 | "type": "string",
|
30 | "format": "path",
|
31 | "description": "The path at which to create the interface that defines the guard, relative to the current workspace.",
|
32 | "visible": false
|
33 | },
|
34 | "project": {
|
35 | "type": "string",
|
36 | "description": "The name of the project.",
|
37 | "$default": {
|
38 | "$source": "projectName"
|
39 | }
|
40 | },
|
41 | "lintFix": {
|
42 | "type": "boolean",
|
43 | "default": false,
|
44 | "description": "When true, applies lint fixes after generating the guard.",
|
45 | "x-user-analytics": 15
|
46 | },
|
47 | "implements": {
|
48 | "type": "array",
|
49 | "description": "Specifies which interfaces to implement.",
|
50 | "uniqueItems": true,
|
51 | "minItems": 1,
|
52 | "items": {
|
53 | "enum": [
|
54 | "CanActivate",
|
55 | "CanActivateChild",
|
56 | "CanDeactivate",
|
57 | "CanLoad"
|
58 | ],
|
59 | "type": "string"
|
60 | },
|
61 | "default": [
|
62 | "CanActivate"
|
63 | ],
|
64 | "x-prompt": "Which interfaces would you like to implement?"
|
65 | }
|
66 | },
|
67 | "required": [
|
68 | "name"
|
69 | ]
|
70 | }
|