If I use es6/7 (babel - stage 1) instead of TypeScript, how are services, and specifically Http, injected?
Here\'s my component JS:
import {Compone
How I've already answered it here, If you write code in ES7, use static getter for parameters property to specify injections into constructor of your component. For example:
import { Http } from 'angular2/http';
// other imports ...
// component decorators ...
export class Login {
static get parameters() {
return [[Http]];
}
constructor(http) {
this.http = http;
console.log('http', http);
}
// other methods
}
I think it most concise method at this moment.
Remember there is no proposal to support parameter decorators in ES7 at this moment (for example see this issue for Babel).