获取参数id的值
app.config(['$locationProvider', function ($locationProvider) {
$locationProvider.html5Mode({
enabled: true,
requireBase: false//必须配置为false,否则<base href=''>这种格式带base链接的地址才能解析
});
}]);
app.controller('userController', ['$scope', '$location', function ($scope, $location) {
alert($location.search().id);
if ($location.search().id) {
$scope.keyword = $location.search().id;
}
}]);
enabled: true,
requireBase: false//必须配置为false,否则<base href=''>这种格式带base链接的地址才能解析
});
}]);
app.controller('userController', ['$scope', '$location', function ($scope, $location) {
alert($location.search().id);
if ($location.search().id) {
$scope.keyword = $location.search().id;
}
}]);
本文转自94cool博客园博客,原文链接:http://www.cnblogs.com/94cool/p/5942476.html,如需转载请自行联系原作者