angular

import { Component } from '@angular/core';

@Component({

    selector: 'my-comp',

    template: '<ul><li *ngFor='let row of dataList'>ID:{{row.id}}  INFO:{{row.info}}</li></ul>',

    styles: [`ul{padding-left: 10px;list-style: none;}`]

})
export class MyComponent {

    dataList = [
        { id: 1, info: "Angular" },
        { id: 2, info: "React" },
        { id: 3, info: "Vue" }
    ];

}

posted on 2019-05-06 16:38  冰love  阅读(102)  评论(0编辑  收藏  举报

导航