2
我試圖使用$location
在angular.js
提供queryparams
。我的下面的代碼在Firefox中完美工作,但在Internet Explorer 11中不起作用。如果我刪除$location
代碼,那麼它的工作原理。
app.config(['$locationProvider', function($locationProvider) {
$locationProvider.html5Mode(true);
}]);
app.controller('appName',
['$scope', '$location', '$http', function($scope, $location, $http) {
alert(JSON.stringify($location));
}]);
的錯誤是很難理解:
Error: Invalid argument. at xa (https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9 /angular.min.js:147:373) at hd (https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js:97:498) ...
有什麼我做錯了嗎?除了$location.search()
之外,還有另外一種方法可以從IE 11中提取queryparams
?
謝謝!
嘗試添加到您的index.html – Chisko