如何使 ionic 2 应用程序的打字稿可选?
How to make typescript optional for ionic 2 applications?
如果我需要在 ionic 2 应用程序的 Angular 组件中导入新的 JS 库,我首先需要通过打字来安装类型。
我认为 typescript 对于 ionic 2 是可选的。
我需要如何配置 Ionic 2 才能跳过这个额外的步骤?
恐怕几周前我在 ionic-v2
Slack 频道中询问过 Ionic Team 的一位开发人员的回答是:
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
因此 Typescript 对于 Ionic 2 应用程序不是可选的。
更新:
Ionic2 resource pages 中还有一个 All in on TypeScript 部分,其中 Ionic 团队解释了使用 TypeScript 的好处:
TypeScript is a superset of JavaScript that gives you advantages like:
- Optional static typing (the key here is optional)
- Type Inference, which gives some of the benefits of types, without actually using them
- Access to ES6 and ES7 features, before they become supported by major
browsers
- The ability to compile down to a version of JavaScript that
runs on all browsers
- Great tooling support with IntelliSense
Because of these awesome features and the huge advantages it gives to you as a
developer, Ionic 2 apps are written in TypeScript, instead of ES6.
如果我需要在 ionic 2 应用程序的 Angular 组件中导入新的 JS 库,我首先需要通过打字来安装类型。
我认为 typescript 对于 ionic 2 是可选的。
我需要如何配置 Ionic 2 才能跳过这个额外的步骤?
恐怕几周前我在 ionic-v2
Slack 频道中询问过 Ionic Team 的一位开发人员的回答是:
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
因此 Typescript 对于 Ionic 2 应用程序不是可选的。
更新:
Ionic2 resource pages 中还有一个 All in on TypeScript 部分,其中 Ionic 团队解释了使用 TypeScript 的好处:
TypeScript is a superset of JavaScript that gives you advantages like:
- Optional static typing (the key here is optional)
- Type Inference, which gives some of the benefits of types, without actually using them
- Access to ES6 and ES7 features, before they become supported by major browsers
- The ability to compile down to a version of JavaScript that runs on all browsers
- Great tooling support with IntelliSense
Because of these awesome features and the huge advantages it gives to you as a developer, Ionic 2 apps are written in TypeScript, instead of ES6.