As mentioned above for ES5, you should use the UMD modules: angular2-all.umd.js and Rx.umd.js For Typescript or ES6, use angular2.js and Rx.js (they also require system.js ).
You can also use ES6 style modules with ES5 as a training exercise: ( https://jsfiddle.net/8g5809rg/ )
<html> <head> <script src="https://code.angularjs.org/tools/system.js"></script> <script src="https://code.angularjs.org/2.0.0-beta.13/Rx.js"></script> <script src="https://code.angularjs.org/2.0.0-beta.13/angular2-polyfills.js"></script> <script src="https://code.angularjs.org/2.0.0-beta.13/angular2.js"></script> <script> System.import("angular2/core").then(function(core) { ParentComponent.annotations = [ new core.Component({ selector: 'body', template: '<div (click)="go()">Parent</div><child [prop1]="x"></child>', directives: [ChildComponent] }) ]; function ParentComponent() { this.x = "hello1" } ParentComponent.prototype.go = function() { this.x += "1" }; </script> </head> <body> </body> </html>
source share