我正在学习 Angular 2,我想知道是否可以通过使用这样的组件选择器来应用 css 样式:
组件
@Component({
selector: 'app',
styleUrl: './local.css',
templateUrl: './app.html',
})
export class AppComponent { }
样式
app {
width: 10px;
height: 100px;
background-color: red;
}
假设这是可能的,这是最好的方法吗?