I have an angularjs app, that sits on top of an MVC5 app and an WEB API backend. I am using UI Router for the Angular js routing and for now, have removed ALL $urlRouterProvider.when and $urlRouterProvider.otherwise calls, but still when I try to do a $http:get... it is returning the default home page in the data object and not hitting the service.
My routing is like this:
(function () {
angular.module("OdinSPA")
.config([
"$urlRouterProvider", "$stateProvider", "$httpProvider", "$locationProvider", function ($urlRouterProvider, $stateProvider, $httpProvider, $locationProvider) {
$locationProvider.hashPrefix("!").html5Mode(true);
$stateProvider
.state("start", {
url: "/start",
templateUrl: "/Search/dashboard"
})
.state("guru", {
...
});
$httpProvider.interceptors.push("AuthHttpResponseInterceptor");
}
]);
})();
My angularjs service is this...
function updateHistory() {
return $http.get(urlBase + "/" + textUpdate.Id + "/standardreport/history", textUpdate).
success(function(data, status, headers, config) {
logoutResponse(data, status, headers, config);
}).
error(function (data, status, headers, config) {
logoutResponse(data, status, headers, config);
});
};
But all that is returned in the data parameter is the entire HTML for the home page (which I won't post as it's pointless) and a 200 status code...
There is only one other article that mentions this problem but the only answer is by the same person and talks about EF, which I don't believe is the issue here!!