angularjs组件
cd到项目中
ng g 创建提示
ng g component 创建组件
ng g component components/news 在components目录下创建news组件
在app.module.ts中引入组件,再在下方的delaration中配置组件
ng serve --open 运行项目
可在export中定义数据,在页面中双大括号进行数据绑定
cd到项目中
ng g 创建提示
ng g component 创建组件
ng g component components/news 在components目录下创建news组件
在app.module.ts中引入组件,再在下方的delaration中配置组件
ng serve --open 运行项目
可在export中定义数据,在页面中双大括号进行数据绑定