1.

Write The Difference Between Directive And Component In Angular Js?

Answer»

In angular js, there are DIFFERENCES between the meta-data annotations. Some of the differences are:

  • A directive is used to add behavior to an EXISTING ELEMENT. Whereas, a component is used to create a component with attached behavior.
  • “@directive” is used to create a directive. Whereas, “@component” is used to create a component.
  • A directive is used to ATTACH different behaviors to an existing DOM element. Whereas, with the help of component, we can break our application into smaller components.
  • A directive is used to create reusable behavior. Whereas, a component is used to create reusable components.
  • A directive does not require a view. Whereas, a component needs a view via @view.

In angular js, there are differences between the meta-data annotations. Some of the differences are:



Discussion

No Comment Found