angular5 directive和component的区别

 

 

指令分为三类,组件属性指令结构性指令布局

  • 组件(Component directive):UI组件,继承于Directive
  • 属性指令(Attribute directive):改变组件的样式
  • 结构指令(Structural directive):改变DOM布局

属性指令例如 ngClass  ngStylespa

结构性指令   *ngIf    *ngFor   *ngSwitchcode

 

参考自http://mttcug.cnblogs.com/blog

相关文章
相关标签/搜索