zoukankan      html  css  js  c++  java
  • angular $location常用方法使用

      $location提供了一些常用的操作和获取地址栏里的地址的方法。

    <script type="text/javascript">
                angular.module('app',[])
                .controller('myCtrl',function($scope,$location){
                    console.info('绝对地址:'+$location.absUrl());
    
                    console.info('#后面的地址带参数:'+$location.url());
    
                    console.info('#后面的地址且不带参数:'+$location.path());
    
                    console.info('获取参数的键值对:'+JSON.stringify($location.search()));  
    
                    console.info('设置地址参数'+JSON.stringify($location.search('param1','hello word').search()));
                });
          </script>
  • 相关阅读:
    JQuery hover鼠标变换
    装饰者模式
    principle04
    Method Injection
    观察者模式
    Java SPI
    Redis--学习01
    OO设计中5大原则
    knowledge
    策略模式
  • 原文地址:https://www.cnblogs.com/freefish12/p/5784660.html
Copyright © 2011-2022 走看看