<!DOCTYPE html>
<title>Hello Angular</title>
<ng-component>Loading...</ng-component>
<script src="https://unpkg.com/rxjs/bundles/rxjs.umd.js"></script>
<script src="https://unpkg.com/@angular/core"></script>
<script src="https://unpkg.com/@angular/common"></script>
<script src="https://unpkg.com/@angular/compiler"></script>
<script src="https://unpkg.com/@angular/platform-browser"></script>
<script src="https://unpkg.com/@angular/platform-browser-dynamic"></script>
<script>
const { Component, NgModule } = ng.core
const { BrowserModule } = ng.platformBrowser
const { platformBrowserDynamic } = ng.platformBrowserDynamic
class AppComponent { }
AppComponent.annotations = [
new Component({
template: '<h1>Hello Angular</h1>',
})
]
class AppModule { }
AppModule.annotations = [
new NgModule({
imports: [
BrowserModule,
],
declarations: [
AppComponent,
],
bootstrap: [
AppComponent,
],
})
]
window['Zone'] = {
get current() { return this },
assertZonePatched() { },
fork() { return this },
get() { return true },
run(fn) { return fn() },
runGuarded(fn) { return fn() },
}
platformBrowserDynamic().bootstrapModule(AppModule, { ngZone: 'noop' })
</script>
Learn Angular the hard way (Simplified Chinese)
https://trotyl.gitbooks.io/learn-angular/content/