How to define default variables for angular schematics "properties" in schema.json?
I have tried to look into the angular source code itself but I couldn't figure it out. I have found out that if the keyword "$source" is being used, somehow the string in front of it will be resolved to some value.
For example "argv" and "projectName" are two variables that they will be resolved to actual values when they are written like this:
"project": {
"alias": "p",
"type": "string",
"description": "The name of the project.",
"$default": {
"$source": "projectName"
}
},
or
"name": {
"type": "string",
"description": "The package name for the new schematic.",
"$default": {
"$source": "argv",
"index": 0
}
},
So how can I define my own variable? Are they actually variables? What other variables are available?
I also found another example which is not working if I copy-paste it into my own project:
"version": {
"type": "string",
"description": "The version of the Angular CLI to use.",
"visible": false,
"$default": {
"$source": "ng-cli-version"
}
},
From my observation, I expect this to be resolved to a value, but I get undefiend.
Thank you folks in advance!