.factory('newPost',function($resource){
return $resource("http://127.0.0.1:port/api/buildpage" , {port: ':3000'});
})
newPost.save({
'title': this.newPostTitle,
'content': this.newPostContent,
'tag':this.newPostTag
},function(e) {
console.log(e);
},function(response){
})
controller A
newPost.get({
},function(e) {
},function(response){
})
controller B
$resouce把$http 封裝好