Please i need to no how to use ionic with cakephp bankend. that is how i tried it

$http.get(‘http://localhost/cakephp2/posts.json’).then(
function (resp) {
console.log(‘the size of data is’+ resp.data.length);
}, function (err) {
console.log(‘ERR’, err);
}
);