Squashed 'seatmap-webapi/' content from commit 02d4bf7
git-subtree-dir: seatmap-webapi git-subtree-split: 02d4bf7404b8fcb788502ca45c813946b6c4f5b9
This commit is contained in:
31
examples/clients/angular2.html
Normal file
31
examples/clients/angular2.html
Normal file
@@ -0,0 +1,31 @@
|
||||
<html>
|
||||
<head>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/2.0.0-beta.14/angular2-polyfills.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/2.0.0-beta.14/Rx.umd.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/2.0.0-beta.14/angular2-all.umd.min.js"></script>
|
||||
<script>
|
||||
AppComponent =
|
||||
ng.core.Component({
|
||||
selector: 'my-app',
|
||||
providers: [ng.http.HTTP_PROVIDERS],
|
||||
template: '<ul><li *ngFor="#x of posts">{{ x.id + ", " + x.content }}</li></ul>'
|
||||
})
|
||||
.Class({
|
||||
constructor: [
|
||||
ng.http.Http, function(http) {
|
||||
var url = "/api.php/records/posts";
|
||||
http.post(url,JSON.stringify({user_id:1,category_id:1,content:"from angular2"})).subscribe();
|
||||
http.get(url).map(res => res.json()).subscribe(res => this.posts = res.records);
|
||||
}
|
||||
]
|
||||
});
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
ng.core.enableProdMode();
|
||||
ng.platform.browser.bootstrap(AppComponent);
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<my-app>Loading...</my-app>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user