使用离子2而不是打字稿应用程序创建一个javascript启动应用程序 [英] Create a javascript starter app with ionic 2 rather than a typescript app

查看:113
本文介绍了使用离子2而不是打字稿应用程序创建一个javascript启动应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个JS启动项目,但 ionic start xxx --v2 创建一个打字稿项目。



<我需要创建一个JS启动项目,这样我就可以将现有的JS ionic 2应用程序复制到一个干净的安装。



我尝试重命名所有的JS文件to typescript但是得到一个类型的错误消息:


yyy类型不存在属性xxx



解决方案

就像你可以阅读 Ionic docs


Ionic 2应用程序创建为TypeScript默认情况下。



想要使用JavaScript吗?传递 - no-ts 标志并获取为JavaScript设置的
项目。


所以你需要运行



ionic start xxx --v2 --no-ts



==============================



编辑:



你是对的。它似乎是文档或Ionic CLI中的错误。在此提交中,您可以看到标题是删除javascript作为选项对于v2项目...... 这里在最后一条评论中提到有关更新文档的内容(因为它说想要使用JavaScript代替?传递--no-ts标志并为JavaScript设置项目。)。



您可以按照进行操作发布,看看Ionic团队的某位成员是否回答了这个问题。



================== ===========



编辑2:



刚刚在 ionic-v2 Slack频道询问,答案是:


我们在TS上全力以赴。



你可以o你自己的工作,并将其转换为es6工作流程,但我们希望人们使用打字稿



I am trying to create a JS starter project but ionic start xxx --v2 creates a typescript project.

I need to create a JS starter project so I can copy across an existing JS ionic 2 app to a clean installation.

I did try renaming all of my JS files to typescript but a get a shed load of error messages of the type:

Property xxx does not exist on type yyy

解决方案

Just like you can read in Ionic docs:

Ionic 2 applications are created as TypeScript by default.

Want to use JavaScript instead? Pass the --no-ts flag and get a project set up for JavaScript instead.

So you would need to run

ionic start xxx --v2 --no-ts

==============================

EDIT:

You're right. It seems to be a bug either in the documentation or in the Ionic CLI. In this commit you can see the title is remove javascript as an option for v2 projects ... and here in the last comment they mention something about updating the docs (because it says Want to use JavaScript instead? Pass the --no-ts flag and get a project set up for JavaScript instead.).

You can follow along this post to see if someone from Ionic Team answer about this issue.

=============================

EDIT 2:

Just asked in ionic-v2 Slack channel and the answer was:

We're going all in on TS.

You could do your own work and covert it toa es6 workflow, but we want people to use typescript

这篇关于使用离子2而不是打字稿应用程序创建一个javascript启动应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆