I have a problem after uploading the ASP Dot MVC Project on server. It works fine on local, but if I upload the build on server, Angular gives an error.
Using AngularJS v1.8.2, libraries are
angular.js and
angular-route.js.
I tried many solutions but they are not working. I don't know why it's happening on server. I just want to run my project properly.
Angular Controller Code looks like this:
angular.module('myAppOpd', ['ngRoute']).controller('OpCtrl', ['$scope', '$http', '$location', function ($scope, $http, $location) {
$scope.init = function ()
{
$scope.initNewPatientReg();
}
$scope.initNewPatientReg = function () {
$http(
{
method: 'Get',
url: '/Opd/GetNewReg',
data: null
}).then(function (response, status, headers, config) {
if (response.status == 200) {
$scope.NewList = response.data;
}
}).catch(function (data, status, headers, config, $scope) {
console.log($scope.message, 'Error!');
});
}
}]).config(function ($locationProvider) {
$locationProvider.html5Mode(true);
});
And the view looks like this:
<div class="content" ng-app="myAppOpd" ng-controller="OpdDashboardCtrl" ng-init="init()">
<div class="row">
<div class="col-md-6 col-sm-6 col-lg-6 col-xl-3">
<div class="dash-widget">
<div class="dash-widget-info text-right">
<h3>98</h3>
</div>
</div>
</div>
<div class="col-md-6 col-sm-6 col-lg-6 col-xl-3">
<div class="dash-widget">
<div class="dash-widget-info text-right">
<h3>{{NewPatientList.length}}</h3>
</div>
</div>
</div>
</div>
</div>
and the error is when running the project on IIS.
Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.8.2/$injector/modulerr?
What I have tried:
I used many of things from Google, but still, my project does not work.