Q. What is the main difference between structural and attribute directives in Angular?

  • (A) Structural directives change DOM layout; attribute directives change element appearance or behavior
  • (B) Attribute directives change DOM layout; structural directives change appearance
  • (C) Both change the DOM layout
  • (D) Both change element styles
πŸ’¬ Discuss
βœ… Correct Answer: (A) Structural directives change DOM layout; attribute directives change element appearance or behavior
Explanation: Structural directives modify DOM structure like *ngIf, *ngFor; attribute directives modify elements without changing structure.
Explanation by: Mr. Dubey
Structural directives modify DOM structure like *ngIf, *ngFor; attribute directives modify elements without changing structure.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
92
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
93%
Success Rate