首页 > 解决方案 > 为什么 styleurls 使用方形后退,而 templateurl 不使用?

问题描述

@Component({
 selector: 'app-heroes',
 templateUrl: './heroes.component.html',
 styleUrls: ['./heroes.component.css']

我的问题是为什么它使用方括号而其他人不使用?

标签: angularcomponents

解决方案


您不能拥有multiple templates组件single,但您可以different styles配置简单组件。

这就是为什么你有styleUrlsas 数组。


推荐阅读