I have a problem when implementing the angularJs ngInfiniteScroll library with Laravel, the truth is that I have not encountered this error here in my Angular Services
function PostServices($http, $q, CONFIG) {
return {
getPots: getPots,
// postCheck: postCheck,
postSave: postSave
};
this.recipes = [];
this.loading = false;
this.page = 1;
function getPots() {
var url = CONFIG.APIURL + 'post/ajaxviewpublish?page=' + this.page;
if (this.loading) return;
this.loading = true;
$http.get(url)
.success(function (data) {
console.log(data.message.data);
for (var i = 0; i < data.message.data.length; i++) {
this.recipes.push(data.message.data[i]);
}
this.page++;
this.loading = false;
recipes.loading = true; // This should prevent more code from being loaded.
}.bind(this));
}
return getPots;
Maybe 'this' is referencing the wrong object, try the following:
Maybe you have to do the same for
page
yloading