1. import { Component } from '@angular/core';
    2. @Component({
    3. // 指定组件的使用方式, 当前为标记形式
    4. // app-home => <app-home></app-home>
    5. // [app-home] => <div app-home></div>
    6. // .app-home => <div class="app-home"></div>
    7. selector: 'app-root',
    8. // 关联组件模板文件
    9. // templateUrl:'组件模板文件路径'
    10. // template:`组件模板字符串`
    11. templateUrl: './app.component.html',
    12. // 关联组件样式文件
    13. // styleUrls : ['组件样式文件路径']
    14. // styles : [`组件样式`]
    15. styleUrls: ['./app.component.scss']
    16. })
    17. export class AppComponent {
    18. title = 'angular-test';
    19. }