Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use @Inject instead of static get parameters() #6959

Closed
mirkonasato opened this issue Jun 18, 2016 · 4 comments
Closed

Use @Inject instead of static get parameters() #6959

mirkonasato opened this issue Jun 18, 2016 · 4 comments

Comments

@mirkonasato
Copy link

Ionic 2 starter projects currently uses static get parameters() in esnext code as a workaround for the lack of parameter decorators in Babel. See e.g. Adding Pages in the tutorial.

Parameters decorators should now work using the babel-plugin-angular2-annotations: see shuhei/babel-plugin-angular2-annotations#19

So it should be possible to write

constructor(@Inject(NavController) nav, @Inject(NavParams) navParams) { /*...*/ }
@Ionitron Ionitron added the v2 label Jun 18, 2016
@mirkonasato
Copy link
Author

Just noticed that the latest ionic-cli only supports typescript. So this doesn't matter any more.

@manucorporat
Copy link
Contributor

@mirkonasato yeah! we took the decision to drop js support, since TS is a superset of JS it's up to developers to use the new features introduced.

This way we can concentrate our efforts of documentation, demos and testing.

@mirkonasato
Copy link
Author

@manucorporat good decision 👍

@gustavohenke
Copy link

@manucorporat, what a shame that you guys took that decision.

TypeScript is simply too slow for me, so from the start I decided to use ES6.
I learned to write Angular 2 ES6 code using Ionic's templates. Not anywhere else in the web there was another starting point as good as Ionic.

And, to complete.. the official Angular docs are just poor in terms of ES6 support.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants