Cs fixes
This commit is contained in:
parent
6aa3f431ce
commit
f0234db13c
1 changed files with 10 additions and 9 deletions
|
|
@ -5,20 +5,21 @@
|
|||
<script>
|
||||
var app = angular.module('myApplication', []);
|
||||
app.controller('postController', function($scope, $http) {
|
||||
var url = '../api.php/posts';
|
||||
$http.post(url,{user_id:1,category_id:1,content:"from angular"}).success(function(){
|
||||
$http.get(url).success(function(response){
|
||||
$scope.posts = php_crud_api_transform(response).posts;
|
||||
});
|
||||
});
|
||||
var url = '../api.php/posts';
|
||||
$http.post(url, {user_id: 1, category_id: 1, content: "from angular"}).success(function() {
|
||||
$http.get(url).success(function(response) {
|
||||
$scope.posts = php_crud_api_transform(response).posts;
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div ng-app="myApplication" ng-controller="postController">
|
||||
<ul>
|
||||
<li ng-repeat="x in posts">{{ x.id + ', ' + x.content }}</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li ng-repeat="x in posts">{{ x.id + ', ' + x.content }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue