首页 > 解决方案 > 为什么单独的“样式”在@Component 装饰器内有一个方括号?

问题描述

我能知道为什么单独的“样式”在@Component 装饰器内有一个方括号吗?我知道 [] 用于属性绑定和数组。

@Component({
  selector: 'app-component-overview',
  template: '<h1>Hello World!</h1>',
  styles: ['h1 { font-weight: normal; }']
})

标签: angular

解决方案


推荐阅读