Reputation: 7
I'm working on a web application using AngularJS. Everything seemed to work well until I tried to run it with Microsoft Edge web-browser:
Error: [$injector:unpr] Unknown provider: serviceAjaxProvider <- serviceAjax <- MainCtrl
I created a service, called serviceAjax and never had any problem with it on Chrome or Firefox. But now that I'm trying to use my app on Edge I got this error.
My service is declared as the following :
serviceAjax.js
angular.module('myApp')
.service('serviceAjax', ['$http', function ($http) {
...
}]);
And I call it like this in my controller :
main.js
angular.module('myApp')
.controller('MainCtrl', function ($scope,serviceAjax) {
...
});
Where does this error come from, and how can I fix it ?
Upvotes: 0
Views: 4427
Reputation: 7
Okay, I found out why it didn't work :
In fact it seems that IE doesn't understand everything written in ES6.
I used a ES6 Default Parameter :
function(var = value) {...};
So avoid using ES6 :)
(I also had compability problems with ES6 & Firefox)
Upvotes: -1
Reputation: 1118
Add this:
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
Upvotes: 2