【摘要】后台管理系统权限控制到按钮级别,将每一个资源的key绑定在url中,渲染页面的时候去根据key来获取当前页面的按钮列表。

router.js

angular.module("app.router", [])
  .config(['$routeProvider',function($routeProvider) {
    $routeProvider
      //单个参数
      .when("/index/:paramName",{
        templateUrl: "app/index",
        controller: "indexCtrl"
      })
      //多个参数  
      .when("/index/:paramName1/:paramName2",{        
        templateUrl: "app/index",         
        controller: "indexCtrl"       
      })
  }])
}());

controller.js

;(function () {
  "use strict";
  angular.module("app.ctrls")
  .controller('indexCtrl', ['$scope', 'indexServices', '$routeParams',
  function ($scope, indexServices, $routeParams) {
    $routeParams.paramName
}]); }());

  

通过  :paramName 来指定路由的参数,然后在页面的控制器中使用 $routeParams.paramName 来解析参数。

  

 

随机推荐

  1. atitit. java queue 队列体系and自己定义基于数据库的队列总结o7t

    atitit. java queue 队列体系and自己定义基于数据库的队列总结o7t 1. 堵塞队列和非堵塞队列 1 2. java.util.Queue接口. 1 3. ConcurrentLin ...

  2. UE4的JSON读写方式<一>

    声明:全部权利保留. 转载必须说明出处:http://blog.csdn.net/cartzhang/article/details/41009343 UE4的Json的解析博客地址: http:// ...

  3. smarty课程---smarty的处理过程是怎样的

    smarty课程---smarty的处理过程是怎样的 一.总结 一句话总结:编译文件里时间戳记录模板文件修改时间,如果模板被修改过就可以检测到,然后重新编译 1. smarty将php源文件,首先编译 ...

  4. thinkphp里面的or查询

    thinkphp里面的or查询 whereOr 方法 使用whereOr 方法进行OR 查询: Db::table('think_user') ->where('name','like','%t ...

  5. poj--3281-- DiningI(最大流)

    Dining Time Limit: 2000MS   Memory Limit: 65536KB   64bit IO Format: %I64d & %I64u Submit Status ...

  6. 分析一下jquery中的ajax操作

    在web前端开发中,ajax是很重要的一项技术,用原生写起来很是麻烦,需要一大堆js代码,而到了jq里就被精简了许多,一起来看看: jquery中的ajax分为三种方式: 1.$.get(),get方 ...

  7. python jieba分词工具

    源码地址:https://github.com/fxsjy/jieba 演示地址:http://jiebademo.ap01.aws.af.cm/ 特点 1,支持三种分词模式: a,精确模式,试图将句 ...

  8. javaScript 三目运算符初探

    三目运算符 三目运算符,又称条件运算符,是计算机语言的重要组成部分.它是唯一有3个操作数的运算符,所以有时又称为三元运算符.一般来说,三目运算符的结合性是右结合的. 定义 对于条件表达式b ? x : ...

  9. Expression表达式树(C#)

    Lambda表达式: 1.下面举例通过Lambda表达式创建了一个用于验证Name的Func委托. //通过Lambda表达式创建一个对象的Name属性验证委托 Func<SearchInfo, ...

  10. [Python] Reuse Code in Multiple Projects with Python Modules

    A module is a function extracted to a file. This allows you to import the function and use it in any ...