mardi 11 août 2015

How often must you use custom directives in AngularJS?

Modularity is one of the key design element that cannot be ignored. But when using Angular's custom directives, where should one exercise the concept and where should one use restraint. Lets say, you have a custom directive at the table level, that you could use anywhere you want, should it also contain the functionality and navigation logic assigned inside it? If a directive contains navigation logic, which acts like a sub routine (task flow) of its own, is it considered a good design?

What are some good example where you decide to use directives, and some examples where you decide to use a standard controller method instead?

Aucun commentaire:

Enregistrer un commentaire