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.

client_ng.html 718B

1234567891011121314151617181920212223
  1. <html>
  2. <head>
  3. <script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
  4. <script src="php_crud_api_transform.js"></script>
  5. <script>
  6. var app = angular.module('myApplication', []);
  7. app.controller('postController', function($scope, $http) {
  8. $http.post("http://localhost/api.php/posts",{user_id:1,category_id:1,content:"from angular"});
  9. $http.get("http://localhost/api.php/posts")
  10. .success(function(response) { $scope.posts = php_crud_api_transform(response).posts; });
  11. });
  12. </script>
  13. </head>
  14. <body>
  15. <div ng-app="myApplication" ng-controller="postController">
  16. <ul>
  17. <li ng-repeat="x in posts">
  18. {{ x.id + ', ' + x.content }}
  19. </li>
  20. </ul>
  21. </div>
  22. </body>
  23. </html>