Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

What is the difference between a structural and an attribute directive?

  1. A Structural directives change the DOM layout; attribute directives change appearance or behaviour
  2. B Attribute directives add elements
  3. C They are the same
  4. D Structural directives only work on inputs
Answer

Structural directives change the DOM layout; attribute directives change appearance or behaviour

Structural directives such as ngIf and ngFor use the asterisk prefix and add or remove elements. ngClass and ngStyle are attribute directives.

All Angular MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as