|
@@ -23,7 +23,7 @@ AppComponent =
|
23
|
23
|
};
|
24
|
24
|
var url = "../api.php";
|
25
|
25
|
http.post(url,JSON.stringify({username:"admin",password:"admin"})).subscribe(res => {
|
26
|
|
- url += "/posts?csrf="+res._body;
|
|
26
|
+ url += "/posts?csrf="+JSON.parse(res._body);
|
27
|
27
|
http.post(url,JSON.stringify({user_id:1,category_id:1,content:"from angular2"})).subscribe();
|
28
|
28
|
http.get(url).map(res => php_crud_api_transform(res.json())).subscribe(res => this.posts = res.posts);
|
29
|
29
|
});
|