1
votes

I have seen the syntax for ngfor, ngIf and ngSwitch with template, can anyone help me with, if I want to use ngclass or [class.classname] with template syntax in angular 2.

How i can use the class with template syntax in angular 2

1
Please show the code that demonstrates what you try to accomplish, what you tried and where you failed (with exact error message). See also angular.io/docs/ts/latest/api/common/index/…, angular.io/docs/ts/latest/api/common/index/…, angular.io/docs/ts/latest/api/common/index/NgIf-directive.htmlGünter Zöchbauer

1 Answers

1
votes

If you use <ng-container> instead of <template> you can use the same syntax as everywhere else.