This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env: | |
- name: NODE_ENV | |
valueFrom: | |
configMapKeyRef: | |
name: basic-config # name of the configmap | |
key: NODE_ENV # key within the configmap | |
- name: SOME_VALUE | |
valueFrom: | |
configMapKeyRef: | |
name: basic-config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: ConfigMap # it is a config map | |
data: # key value pairs | |
NODE_ENV: "production" | |
SOME_VALUE: "my config value" | |
metadata: | |
name: basic-config # name to reference |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function waitingRule(options: any): Rule { | |
return (host: Tree) => { | |
const observer = new Observable<Tree>((observer) => { | |
fetch('someUrl.com/') // any async operation | |
.then(res => res.json()) | |
.then(data => { | |
observer.next(host); | |
observer.complete(); | |
}) | |
.catch(function (err: any) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function myCustomRule(options: any): Rule { | |
return (host: Tree) => { | |
return host; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const rule = chain([ | |
rule1, | |
rule2, | |
rule3 | |
]); | |
return rule(host, context); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json-schema.org/schema", | |
"id": "SchematicsMaterialInstall", | |
"title": "Material Install Options Schema", | |
"type": "object", | |
"properties": { | |
"skipPackageJson": { | |
"type": "boolean", | |
"default": false, | |
"description": "Do not add materials dependencies to package.json (e.g., --skipPackageJson)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "./node_modules/@angular-devkit/schematics/collection-schema.json", | |
"schematics": { | |
// Adds Angular Material to an application without changing any templates | |
"ng-add": { | |
"description": "Adds Angular Material to the application without affecting any templates", | |
"factory": "./install", | |
"schema": "./install/schema.json", | |
"aliases": ["material-shell"] # <-- name/alias of Schematic | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// within template chain | |
..., | |
options.uiFramework === UI_FRAMEWORK_OPTION.MATERIAL ? | |
externalSchematic('@angular/material', 'material-shell', { | |
project: options.project | |
}) : noop(), | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DON'T DO THIS | |
options.skipVo ? noop() : schematic("vo", { | |
project: options.project, | |
path: options.path, | |
name: options.vo, | |
spec: options.spec, | |
obj: options.obj | |
}), | |
// DO THIS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
options.skipVo ? noop() : schematic("vo", voOptions), |