Angular 4 supports the syntax below
var HelloComponent = ng.core
Component({
selector: 'hello-cmp',
template: 'Hello World!',
viewProviders: [Service]
.Class({
constructor: [Service, function (service) {
},`
});
In Angular 5, there is no class, anyone can provide Angular 5 with ES5 syntax. Currently I cannot switch ES6, so please avoid this suggestion. if switching to ES6 is the only way, then I will stick with Angular 4 for now
source
share