Question:

When should you use an attribute versus an element?

Answer:

Use an element when you are creating a component that is in control of the template. Use an attribute when you are decorating an existing element with new functionality.

This topic is important so developers can understand the several ways a directive can be used inside a view and when to use each way.

Sources: https://docs.angularjs.org/api/ng/service/$compile#directive-definition-object


Keywords:

© 2017 QuizBucket.org