api de gestion de ticket, basé sur php-crud-api. Le but est de décorrélé les outils de gestion des données, afin
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

angular2.html 1.1KB

12345678910111213141516171819202122232425262728293031
  1. <html>
  2. <head>
  3. <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/2.0.0-beta.14/angular2-polyfills.min.js"></script>
  4. <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/2.0.0-beta.14/Rx.umd.min.js"></script>
  5. <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/2.0.0-beta.14/angular2-all.umd.min.js"></script>
  6. <script>
  7. AppComponent =
  8. ng.core.Component({
  9. selector: 'my-app',
  10. providers: [ng.http.HTTP_PROVIDERS],
  11. template: '<ul><li *ngFor="#x of posts">{{ x.id + ", " + x.content }}</li></ul>'
  12. })
  13. .Class({
  14. constructor: [
  15. ng.http.Http, function(http) {
  16. var url = "/api.php/records/posts";
  17. http.post(url,JSON.stringify({user_id:1,category_id:1,content:"from angular2"})).subscribe();
  18. http.get(url).map(res => res.json()).subscribe(res => this.posts = res.records);
  19. }
  20. ]
  21. });
  22. document.addEventListener("DOMContentLoaded", function(event) {
  23. ng.core.enableProdMode();
  24. ng.platform.browser.bootstrap(AppComponent);
  25. });
  26. </script>
  27. </head>
  28. <body>
  29. <my-app>Loading...</my-app>
  30. </body>
  31. </html>