問(wèn)題描述
我正在嘗試創(chuàng)建一個(gè) JS 入門(mén)項(xiàng)目,但 ionic start xxx --v2
創(chuàng)建了一個(gè)打字稿項(xiàng)目.
I am trying to create a JS starter project but ionic start xxx --v2
creates a typescript project.
我需要?jiǎng)?chuàng)建一個(gè) JS 啟動(dòng)項(xiàng)目,以便可以將現(xiàn)有的 JS ionic 2 應(yīng)用程序復(fù)制到全新安裝中.
I need to create a JS starter project so I can copy across an existing JS ionic 2 app to a clean installation.
我確實(shí)嘗試將我所有的 JS 文件重命名為 typescript,但得到了一些類型的錯(cuò)誤消息:
I did try renaming all of my JS files to typescript but a get a shed load of error messages of the type:
類型 yyy 上不存在屬性 xxx
Property xxx does not exist on type yyy
推薦答案
就像你可以閱讀 離子文檔:
Ionic 2 應(yīng)用程序默認(rèn)創(chuàng)建為 TypeScript.
Ionic 2 applications are created as TypeScript by default.
想改用 JavaScript 嗎?傳遞 --no-ts
標(biāo)志并獲得一個(gè)而是為 JavaScript 設(shè)置的項(xiàng)目.
Want to use JavaScript instead? Pass the --no-ts
flag and get a
project set up for JavaScript instead.
所以你需要運(yùn)行
ionic start xxx --v2 --no-ts
================================
==============================
你是對(duì)的.這似乎是文檔或 Ionic CLI 中的錯(cuò)誤.在這個(gè) commit 你可以看到標(biāo)題是 remove javascript as an option對(duì)于 v2 項(xiàng)目 ... 和 這里 在他們最后的評(píng)論中提到一些關(guān)于更新文檔的事情(因?yàn)樗f(shuō) 想改用 JavaScript?傳遞 --no-ts 標(biāo)志并為 JavaScript 設(shè)置一個(gè)項(xiàng)目.).
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.).
您可以關(guān)注此帖子看看 Ionic Team 是否有人回答了這個(gè)問(wèn)題.
You can follow along this post to see if someone from Ionic Team answer about this issue.
==============================
=============================
編輯 2:
剛剛在 ionic-v2
Slack 頻道中詢問(wèn),答案是:
Just asked in ionic-v2
Slack channel and the answer was:
我們將全力以赴.
您可以自己完成工作并將其轉(zhuǎn)換為 es6 工作流程,但我們希望人們使用 typescript
You could do your own work and covert it toa es6 workflow, but we want people to use typescript
這篇關(guān)于使用 ionic 2 而不是 typescript 應(yīng)用程序創(chuàng)建一個(gè) javascript starter 應(yīng)用程序的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!