在 Angular CLI 项目结构中创建 ionic 4 应用程序

Create ionic 4 app inside Angular CLI projects structure

我正在寻找一种“离子启动”项目并将其放在现有 Angular CLI 解决方案(已经包含网络应用程序和库)的项目文件夹中的方法。

所以没有官方的 ionic cli 命令可以做到这一点,但你可以做到

ng add @ionic/angular

在项目中,它会为您将必要的部分添加到网络应用程序。

除此之外,总是有手动安装方式 ionic/angular

  • npm install @ionic/angular
  • npm install @ionic/angular-toolkit
  • 在样式数组中添加样式 listed here
  • 包括列出的 ionicons 资产 here
  • 添加列出的本机构建任务 here。如果您计划部署到本机 iOS 和本机 android
  • ,则这是可选的

感谢您让我们走上正确的道路!

我 运行 遇到的小问题是:当我 运行 ng add @ionic/angular 时,它安装了 0.2.2 版本并抛出以下错误

The package that you are trying to add does not support schematics. You can try using a different version of the package or contact the package author to add ng-add support.

我必须 运行 ng add @ionic/angular@4.6.0 才能正常工作