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_angular.html 709B

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