Is it needed to learn TypeScript for Angular 2?
Can Angular 2 be used with plain JavaScript ?
Edit: I\'ve seen that the languages used as ES6, ES7, Dart comp
A simple way to write plain javascript es5 components:
(function() {
var MyComponent = ng.
Component({
selector: 'my-component'
})
.View({
templateUrl: 'my-component.html'
})
.Class({
constructor: function () {
this.someArray = [];
},
someCustomFunction: function(item) {
this.someArray.push(item);
...
}
})
document.addEventListener('DOMContentLoaded', function() {
ng.bootstrap(MyComponent);
});
})();
Here is a simple todo list demo using Javascript es5.