mardi 22 avril 2014

AngularJS Directive Restrict A vs E


Vote count:

0




I'm working in a small team, building in AngularJS and trying to maintain some basic standards & best practices; especially given we're relatively new with Angular.


My question is with regards to Directives. More accurately, the restrict options.


Some of us are using restrict: 'E' thus having <my-directive></my-directive> in the html.


Others are using restrict:Aand having` in the html.


Then, of course, you can use restrict: 'EA' and use either of the above.


At the moment it's no big deal, though when this project is as big as it's going to get I would like anybody looking at it to easily understand what's going on.


Are there pros/cons to either the attribute or element way of doing things?


Are there any pitfalls we should know, if choosing say element over attribute?



asked 26 secs ago

Darren

5,114





Aucun commentaire:

Enregistrer un commentaire