Skip to content

Commit f902f49

Browse files
Chau TranKeen Yee Liau
Chau Tran
authored and
Keen Yee Liau
committed
fix(@schematics/angular): fix extra comma if inlineStyle is on
When generating a new component, if `inlineStyle` and either `viewEncapsulation` or `changeDetection` flag is provided, there is an extra comma after `styles: [],,` causing the component to bugged out.
1 parent 93c2018 commit f902f49

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/schematics/angular/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.ts.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { Component, OnInit<% if(!!viewEncapsulation) { %>, ViewEncapsulation<% }
1414
display: block;
1515
}
1616
`<% } %>
17-
],<% } else { %>
17+
]<% } else { %>
1818
styleUrls: ['./<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %>.<%= style %>']<% } %><% if(!!viewEncapsulation) { %>,
1919
encapsulation: ViewEncapsulation.<%= viewEncapsulation %><% } if (changeDetection !== 'Default') { %>,
2020
changeDetection: ChangeDetectionStrategy.<%= changeDetection %><% } %>

0 commit comments

Comments
 (0)