【发布时间】:2016-10-23 15:15:39
【问题描述】:
我正在尝试在angular.js 中使用$location 来提供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));
}]);
错误很难理解:
错误:参数无效。 在 xa (https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9 /angular.min.js:147:373) 在高清 (https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js:97:498) ...
我做错了什么吗?除了$location.search()之外,还有其他方法可以从IE 11中提取queryparams吗?
谢谢!
【问题讨论】:
-
尝试将 添加到您的 index.html
标签: angularjs