5、创建组件
创建组件的命令
ng generate component <组件名> [options]
简写:ng g c <组件名> [options]
eg:
- ng g c comp1 (在src/app下创建名为comp1的组件)
- ng g c components/comp1 (在src/app/components下创建名为comp1的组件)
常用参数
- changeDetection
- displayBlock
- export
- inlineStyle //行内样式 不再创建单独的style css文件
- inlineTemplate //行内模板 不再创建单独的模板文件
- skipTests //不创建测试文件

浙公网安备 33010602011771号