在Ionic4中创建Component
文章目录
- 创建component :
|
|
- component必须被封装成为module才能使用,添加一个module:
|
|
- 在 my-component.module.ts中:
|
|
当在componet module中使用ionic组件,需要 import IonicModule
需要使用ngfor之类的装饰器的话,需要 import CommonModule
Exports all the basic Angular directives and pipes, such as NgIf, NgForOf, DecimalPipe, and so on. Re-exported by BrowserModule, which is included automatically in the root AppModule when you create a new app with the CLI new command.
- 在使用的页面的module.ts中
|
|
文章作者 p3p3pp3
上次更新 2019-04-04