2016-11-18 63 views
0

我正在学习angular2,并且我在使用角度cli安装的版本中没有生成组件abc的地方有@component,它已结束templateUrl,styleUrl。但是我从angular.io下载的版本有模板,样式,反之亦然。两者有什么区别?@component标记之间的差异x

+0

你读来的文档(HTTPS:/ /angular.io/docs/ts/latest/api/core/index/Component-decorator.html)?例如:*“** template ** - 视图的内嵌定义模板** templateUrl ** - 包含视图”*“模板的外部文件的url。 RTFM! – jonrsharpe

回答

2
  • templateUrlstyleUrls外部 HTML和CSS文件
  • templatestyles用于定义模板和样式在线