Codelyzer: [feat] add a warning when not using trackBy with ngFor

Created on 15 Jul 2017  路  5Comments  路  Source: mgechev/codelyzer

Even though its considered best practise, I always forget to add a trackBy when using ngFor. It would be awesome to have a rule to enforce this in templates. Since invalid usage of trackBy is currently swallowed silently by angular, as a stretch it would be cool if the rule validates the trackBy expression as well. If you're in favour of this I would love to take a go at a PR for this feature. Thanks! 馃槃

enhancement P2

Most helpful comment

I keep track of that ;)

All 5 comments

Sounds like a good suggestion. There's issue related to the errors reporting in ngFor. Once this is fixed it'll be relatively easy to implement.

I came here to post that but @mattlewis92 did it 2 days ago :smile: !
Indeed, I think it would be a really nice feature! :beers:

Will move it to the next release in order to not bloat 3.2.0.

This would be an amazing feature!
... and it even looks like @maxime1992 offered some beer to get it fixed 馃槈

I keep track of that ;)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lazarljubenovic picture lazarljubenovic  路  4Comments

artaommahe picture artaommahe  路  3Comments

fabioemoutinho picture fabioemoutinho  路  5Comments

damsorian picture damsorian  路  3Comments

negberts picture negberts  路  3Comments