I have a website that uses the angularBootstrapNavTree control. It works fine for me on my local machine. On my server, I installed Visual Studio ( it's MVC5 ) and debugged an error that occurred on the server but not locally with serialisation. Now, when I go to my URL of my WebAPI2 service, my data is returned. If I browse to the page with this script ( in a .js file ):
var app, deps;
deps = ['angularBootstrapNavTree'];
if (angular.version.full.indexOf("1.2") >= 0)
{
deps.push('ngAnimate');
}
app = angular.module('PVU', deps);
app.controller('PVUController', function ($scope, $timeout, $http, $window)
{
$scope.doing_async = true;
$scope.data = null;
$http({ method: 'GET', url: '/Products/GetProducts/' }).
success(function (data, status, headers, config)
{
$scope.doing_async = false;
return $scope.my_data = data;
}).
error(function (data, status, headers, config)
{
});
$scope.clickhandler = function (branch)
{
$scope.thedata = branch.data;
$scope.$apply();
};
treedata_avm = [
{
label: 'Loading'
}
];
$scope.my_data = treedata_avm;
});
The page runs, and the tree shows 'loading'. If I set a breakpoint, the success function is called and my data is there. But, from the moment the controller callback is called ( $scope.doing_async = true; ), this error is on my console:
Error: [$injector:unpr] http://errors.angularjs.org/1.2.14/$injector/unpr?p0=nProvider%20%3C-%20n%20%3C-%20abnTreeDirective
at Error (native)
at http://67.214.99.130/bundles/angular?v=RhmTtQ27BhbKD8lYJqRRXD93x9Dmqd7oWtir-Op3k8k1:1:6542
at http://67.214.99.130/bundles/angular?v=RhmTtQ27BhbKD8lYJqRRXD93x9Dmqd7oWtir-Op3k8k1:1:19418
at Object.i [as get] (http://67.214.99.130/bundles/angular?v=RhmTtQ27BhbKD8lYJqRRXD93x9Dmqd7oWtir-Op3k8k1:1:18494)
at http://67.214.99.130/bundles/angular?v=RhmTtQ27BhbKD8lYJqRRXD93x9Dmqd7oWtir-Op3k8k1:1:19493
at i (http://67.214.99.130/bundles/angular?v=RhmTtQ27BhbKD8lYJqRRXD93x9Dmqd7oWtir-Op3k8k1:1:18494)
at Object.r [as invoke] (http://67.214.99.130/bundles/angular?v=RhmTtQ27BhbKD8lYJqRRXD93x9Dmqd7oWtir-Op3k8k1:1:18706)
at http://67.214.99.130/bundles/angular?v=RhmTtQ27BhbKD8lYJqRRXD93x9Dmqd7oWtir-Op3k8k1:1:23593
at Array.forEach (native)
at r (http://67.214.99.130/bundles/angular?v=RhmTtQ27BhbKD8lYJqRRXD93x9Dmqd7oWtir-Op3k8k1:1:6870)
I thought I had the non minified version of Angular installed, but the error shows up at the start of the file, all on one line and unreadable. The link goes to a page that says a module is not defined, but I checked, and all the $xxx objects are valid inside the method, and I don't know that I define anything else...
I am not sure if it's an IIS issue, because everything is working inside Visual Studio, but this is my last deployment task, so I appreciate any help or advice.
Thanks