0

As said,

Directives are instructions in the DOM

so as components work as the instructions in DOM too.

So that Means Components are Directives too but with a template is it right to said so?

i am having difficulty in clearing the difference and comparison of both.

(Preparing for First Angular Job Interview)

Arslan Ameer
  • 1,010
  • 16
  • 30
  • 1
    Yes a Component extends a Directive: `export interface Component extends Directive` (source code), so all components are directives, but not all directives are components – Poul Kruijt Nov 08 '18 at 15:23
  • @PierreDuc : Thank You. So on asking i can say there is no difference except a template in components or Extended directive with a template is component? – Arslan Ameer Nov 08 '18 at 15:37
  • 1
    Yes, technically speaking a directive is to alter behaviour of an element in a uniform way. A component is an encapsulation of certain elements to execute a goal – Poul Kruijt Nov 08 '18 at 19:32

0 Answers0