zoukankan      html  css  js  c++  java
  • AngularJs 1.5 $location获取url参数

    地址:http://localhost/waservice.html?id=17

    获取参数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;
                }
            }]);
  • 相关阅读:
    ios资源
    学习swift开源项目
    学习di'z地址
    IOS基础库
    IT自学论坛
    HVTableView 分享组
    IOS中的动画菜单
    iOS 通讯录操作
    ios中autolayout
    ios 程序学习
  • 原文地址:https://www.cnblogs.com/94cool/p/5942476.html
Copyright © 2011-2022 走看看