简体   繁体   English

如何使用CLI在Ionic中将页面添加到app.module.ts

[英]How to add pages to app.module.ts in Ionic using CLI

I am new to Ionic and when generating the pages in Ionic, we have to manually add the pages to the app.module.ts. 我是Ionic的新手,在Ionic中生成页面时,我们必须手动将页面添加到app.module.ts。

Is there any way to add pages to app.module.ts using CLI in Ionic? 有什么方法可以在Ionic中使用CLI将页面添加到app.module.ts?

I am trying this: ionic g page <pagename> --module=app 我正在尝试: ionic g page <pagename> --module=app

Any answers is much appreciated. 任何答案都非常感谢。

ionic g page <pagename> out to be enough. ionic g page <pagename>列出来就足够了。 It should also automatically add it to your app.module.ts, if not add it to declarations and entryComponents . 如果没有将其添加到declarationsentryComponents ,它还应该自动将其添加到您的entryComponents

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM