K
K
KOPC18862014-11-07 22:02:56
Angular
KOPC1886, 2014-11-07 22:02:56

Why does an error occur?

Hello!
I can't figure out what is causing the Uncaught Error: [$injector:unpr] Unknown provider: $templateRequestProvider <- $templateRequest <- $route
Angular version 1.3.1
Angular route is the same version.
There may be an error due to this code

var servicesCatalog = angular.module('servicesCatalog', [
    'ngRoute',
    'ui.sortable',
    'catalogControllers',
    'angucomplete'
]);

servicesCatalog.run(function($rootScope, $http, $location, $route) {
    $rootScope.ajax = false;
    $rootScope.load_catalog = true;

    var original = $location.path;
    $location.path = function (path, reload) {
        if (reload === false) {
            var lastRoute = $route.current;
            var un = $rootScope.$on('$locationChangeSuccess', function () {
                $route.current = lastRoute;
                un();
            });
        }
        return original.apply($location, [path]);
    };
});

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question