File tree Expand file tree Collapse file tree
packages/schematics/angular Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414 "factory" : " ./component" ,
1515 "description" : " Create an Angular component." ,
1616 "schema" : " ./component/schema.json"
17+ },
18+ "enum" : {
19+ "factory" : " ./enum" ,
20+ "description" : " Create an enumeration." ,
21+ "schema" : " ./enum/schema.json"
1722 }
1823 }
1924}
Original file line number Diff line number Diff line change 1+ export class < %= classify ( name ) % > {
2+ }
Original file line number Diff line number Diff line change 1+ /**
2+ * @license
3+ * Copyright Google Inc. All Rights Reserved.
4+ *
5+ * Use of this source code is governed by an MIT-style license that can be
6+ * found in the LICENSE file at https://angular.io/license
7+ */
8+
9+ import {
10+ Rule ,
11+ apply ,
12+ branchAndMerge ,
13+ chain ,
14+ mergeWith ,
15+ move ,
16+ template ,
17+ url
18+ } from '@angular-devkit/schematics' ;
19+ import * as stringUtils from '../strings' ;
20+
21+
22+ export default function ( options : any ) : Rule {
23+ const templateSource = apply ( url ( './files' ) , [
24+ template ( {
25+ ...stringUtils ,
26+ ...options
27+ } ) ,
28+ move ( options . sourceDir )
29+ ] ) ;
30+
31+ return chain ( [
32+ branchAndMerge ( chain ( [
33+ mergeWith ( templateSource )
34+ ] ) )
35+ ] ) ;
36+ }
Original file line number Diff line number Diff line change 1+ {
2+ "$schema" : " http://json-schema.org/schema" ,
3+ "id" : " SchematicsAngularEnum" ,
4+ "title" : " Angular Enum Options Schema" ,
5+ "type" : " object" ,
6+ "properties" : {
7+ "name" : {
8+ "type" : " string"
9+ },
10+ "path" : {
11+ "type" : " string" ,
12+ "default" : " app"
13+ },
14+ "sourceDir" : {
15+ "type" : " string" ,
16+ "default" : " src"
17+ }
18+ },
19+ "required" : [
20+ " name"
21+ ]
22+ }
You can’t perform that action at this time.
0 commit comments