angular2-style-guide icon indicating copy to clipboard operation
angular2-style-guide copied to clipboard

Style for *ngFor

Open hongbo-miao opened this issue 8 years ago • 3 comments

I saw several kinds of codes online, they are all working well, but I am not sure which style is recommended.

These are three of them:

*ngFor="#alert of alerts #i = index #l = last"
*ngFor="#alert of alerts; #i = index, #l = last"
*ngFor="#alert of alerts; #i = index; #l = last"

Maybe add one style guide for this? Thanks

hongbo-miao avatar Mar 29 '16 03:03 hongbo-miao

I'm mostly for *ngFor="var alert of alerts; var i = index; var l = last.

Any other opinions?

mgechev avatar Apr 06 '16 08:04 mgechev

I prefer

*ngFor="#alert of alerts;#i = index;#l = last;"

yuyang041060120 avatar Apr 07 '16 06:04 yuyang041060120

I think they are all fine, just pick one for the entire style-guide and point to the template syntax doc ?

ludohenin avatar Apr 11 '16 06:04 ludohenin