加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

用Angular 2运行Ionic 2

发布时间:2020-12-17 17:28:23 所属栏目:安全 来源:网络整理
导读:几天前我开始玩Ionic 2和Angular 2,但现在当我运行“离子启动myProjectName blank –v2”时,它总是创建一个带有v3.0.1离子框架的新项目.即使我指定“–v2”它使用Ionic 3.0.1和Angular 4但是我想使用带角度2的Ionic 2,因为我认为现在使用Ionic 3和Angular 4
几天前我开始玩Ionic 2和Angular 2,但现在当我运行“离子启动myProjectName blank –v2”时,它总是创建一个带有v3.0.1离子框架的新项目.即使我指定“–v2”它使用Ionic 3.0.1和Angular 4但是我想使用带角度2的Ionic 2,因为我认为现在使用Ionic 3和Angular 4用于生产网络应用程序还为时尚早.

这是我的命令“$ionic info”输出:

Your system information:

Cordova CLI: 6.5.0
Ionic Framework Version: 3.0.1
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: macOS Sierra
Node Version: v6.10.0
Xcode version: Not installed

和我的package.json依赖项块:

"dependencies": {
    "@angular/common": "4.0.0","@angular/compiler": "4.0.0","@angular/compiler-cli": "4.0.0","@angular/core": "4.0.0","@angular/forms": "4.0.0","@angular/http": "4.0.0","@angular/platform-browser": "4.0.0","@angular/platform-browser-dynamic": "4.0.0","@ionic-native/core": "3.4.2","@ionic-native/splash-screen": "3.4.2","@ionic-native/status-bar": "3.4.2","@ionic/storage": "2.0.1","ionic-angular": "3.0.1","ionicons": "3.0.0","rxjs": "5.1.1","sw-toolbox": "3.4.0","zone.js": "^0.8.4"
  },

[编辑]
如果这个云帮助其他人,我也会在Ionic论坛上发布这个问题.非常感谢https://forum.ionicframework.com/t/ionic-2-with-angular2/86072/2.

解决方法

ionic blog

根据这个,

Using version 2.x of the CLI still requires the --v2 flag to create an app using the latest version of the framework (3.0.1 currently). If you are using the beta (3.0.0-beta.5 is latest) version of the CLI it does not require any flag and will generate an app using the latest version of the framework (3.0.1).

So creating a new app using latest v2 framework (2.2.0 or 2.3.0 I think) is no longer possible. It’s either 1.. or 3.0.0 now.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读