Проблема запуска проекта Laravel Angular JS - PullRequest
0 голосов
/ 23 ноября 2018

Я скачал проект из онлайн.

Вот ссылка.

https://itsolutionstuff.com/post/laravel-52-and-angularjs-crud-with-search-and-pagination-exampleexample.html

Я пытался сделать все, как указано в инструкции, но после всего, что у меня возникла ошибка:

Error: $.gritter is undefined; can't access its "add" property
httpRequest/promise<@http://localhost/lrv/public/app/services/myServices.js:46:9
f/<@https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js:110:390
$eval@https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js:124:246
$digest@https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js:121:324
$apply@https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js:125:10
n@https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js:80:372
O@https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js:84:445
uf/</B.onload@https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js:85:462

Iне знаю, что такое гриттер.

My Service JS, где используется дробилка, как показано ниже:

app.factory('dataFactory', function($http) {
  var myService = {
    httpRequest: function(url,method,params,dataPost,upload) {
      var passParameters = {};
      passParameters.url = url;

      if (typeof method == 'undefined'){
        passParameters.method = 'GET';
      }else{
        passParameters.method = method;
      }

      if (typeof params != 'undefined'){
        passParameters.params = params;
      }

      if (typeof dataPost != 'undefined'){
        passParameters.data = dataPost;
      }

      if (typeof upload != 'undefined'){
         passParameters.upload = upload;
      }

      var promise = $http(passParameters).then(function (response) {
        if(typeof response.data == 'string' && response.data != 1){
          if(response.data.substr('loginMark')){
              location.reload();
              return;
          }
          $.gritter.add({
            title: 'Application',
            text: response.data
          });
          return false;
        }
        if(response.data.jsMessage){
          $.gritter.add({
            title: response.data.jsTitle,
            text: response.data.jsMessage
          });
        }
        return response.data;
      },function(){

        $.gritter.add({
          title: 'Application',
          text: 'An error occured while processing your request.'
        });
      });
      return promise;
    }
  };
  return myService;
});

Спасибо за вашу помощь.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...