export class AppComponent implements OnInit { namesArray = ['John', 'Alex', 'Mary']; ... }
{{ name }}
addItem(newName: string) { this.namesArray.push(newName); }
上一篇:Angular中使用数组构造函数和ngOnInit的问题
下一篇:Angular中使用storybook时,如何对ZorroUI框架进行二次封装并解决可能遇到的问题?