feat(aio): copy example code from angular.io

This commit is contained in:
Peter Bacon Darwin
2017-02-22 18:13:21 +00:00
committed by Igor Minar
parent 3e34ba01bd
commit 1f3198cb50
1704 changed files with 86472 additions and 7 deletions

View File

@ -0,0 +1,55 @@
(function(app) {
// #docregion
// #docregion class-w-annotations
app.AppComponent =
// #docregion component
ng.core.Component({
selector: 'my-app',
// #enddocregion
// #docregion view
template: '<h1 id="output">My First Angular App</h1>'
})
// #enddocregion
// #docregion class
.Class({
constructor: function () { }
});
// #enddocregion
// #enddocregion
// #docregion bootstrap
app.AppModule =
ng.core.NgModule({
imports: [ ng.platformBrowser.BrowserModule ],
declarations: [ app.AppComponent ],
bootstrap: [ app.AppComponent ]
})
.Class({
constructor: function() {}
});
document.addEventListener('DOMContentLoaded', function() {
ng.platformBrowserDynamic
.platformBrowserDynamic()
.bootstrapModule(app.AppModule);
});
// #enddocregion
// #enddocregion
})(window.app || (window.app = {}));
/* Non DSL Approach */
(function(app) {
// #docregion no-dsl
app.AppComponent = function AppComponent () {}
app.AppComponent.annotations = [
new ng.core.Component({
selector: 'my-app',
template: '<h1 id="output">My First Angular App</h1>'
})
];
// #enddocregion
})(window.app || (window.app = {}));