.state('页面被引用时的变量名',{

  template: '<h1>My Contacts</h1>',//被应用时插入的模板,状态被激活时,它的模板会自动插入到父状态对应的模板中包含ui-view属性的元素内部。

  templateUrl:'指定的页面',//来加载指定位置的模板,可以是一个页面也可以是一个返回url的函数

  controller:‘function($scope){$scope.title = 'My Contacts';}’,//或者一个已经定义好的控制器的名字如indexCtrl 

  data: {                                  //可以给 $state 对象提供自定义数据
    customData1: 44,
    customData2: "red"
  },
  reslove:{         //可以使用resolve为控制器提供可选的依赖注入项
      user:function(){
         return {
          name:"shanon",
          email:"1111111111@qq.com"
          }
       },
       controllerAs:'demo'    //demo是定义好的控制器(以indexCtrl为例)的别名,这样在页面中可以使用{{demo.变量/方法}},其中的变量和方法是indexCtrl中$scope下面的变量和方法,实际可以将window.indexCtrl =             //this,使用this代替$scope

})

ui-router .state参数配置的更多相关文章

  1. 【原创】ui.router源码解析

    Angular系列文章之angular路由 路由(route),几乎所有的MVC(VM)框架都应该具有的特性,因为它是前端构建单页面应用(SPA)必不可少的组成部分. 那么,对于angular而言,它 ...

  2. ngRoute 与ui.router区别

    angular路由 路由 (route) ,几乎所有的 MVC(VM) 框架都应该具有的特性,因为它是前端构建单页面应用 (SPA) 必不可少的组成部分. 那么,对于 angular 而言,它自然也有 ...

  3. angular : $location & $state(UI router)的关系

    次序:angular 的 location会先跑 $rootScope.$on("$locationChangeStart", function (scope, newUrl, o ...

  4. angular ui.router 路由传参数

    angular已经用了一段时间了,最近在做路由,做一下笔记. 路由跳转的时候进行穿参 ui.router方式 <a ui-sref="edit({id:5})"> 编辑 ...

  5. angular 的ui.router 定义不同的state 对应相同的url

    Angular UI Router: Different states with same URL? The landing page of my app has two states: home-p ...

  6. 移动端UI自动化Appium测试——DesiredCapabilities参数配置及含义

    一.DesiredCapabilities的作用: 负责启动服务端时的参数设置,启动session的时候是必须提供的. Desired Capabilities本质上是key value的对象,它告诉 ...

  7. ngRoute 和 ui.router 的使用方法和区别

    在单页面应用中要把各个分散的视图给组织起来是通过路由机制来实现的.本文主要对 AngularJS 原生的 ngRoute 路由模块和第三方路由模块 ui.router 的用法进行简单介绍,并做一个对比 ...

  8. angularjs ngRoute和ui.router对比

    ngRoute模块是angularjs自带的路由模块,ui.router是一个第三方路由模块,接下来将对两者进行一个对比: ng-router(angular-router.js) ng-view n ...

  9. AngularJS 使用 UI Router 实现表单向导

    Today we will be using AngularJS and the great UI Router and the Angular ngAnimate module to create ...

随机推荐

  1. ansible实现keepalived和nginx高可用

    实验环境 ansible节点 keepalived+nginx节点1    ansible自动安装配置 keepalived+nginx节点2    ansible自动安装配置 httpd节点1 ht ...

  2. PXE安装操作系统

    TFTP服务 用PXE安装操作系统依赖于DHCP服务和TFTP服务 网卡一般都内置的TFTP客户端的程序 systemctl enable tftp     systemctl enable  dhc ...

  3. shell字符串数组

    数组 声明数组 declare -a ARRAY_NAME declare -A ARRAY_NAME: 关联数组 注意:两者不可相互转换 数组名和下标(索引) 索引:编号从0开始,属于数值索引 注意 ...

  4. 【adaboost】周志华

  5. 1: 创建一个sap demo项目:

    1:  创建一个项目:

  6. Marathon自动扩缩容(marathon-lb-autoscale)

    我们在服务里面创建如下的应用(以下是创建完复制过来的json): { "id": "/nginxtest", "cmd": null, &q ...

  7. Py中reshape中的-1表示什么【转载】

    转自:https://blog.csdn.net/weixin_39449570/article/details/78619196 1.新数组的shape属性应该要与原来数组的一致,即新数组元素数量与 ...

  8. 【LeetCode每天一题】Pow(x, n)(平方)

    Implement pow(x, n), which calculates x raised to the power n (x,n). Example 1:                 Inpu ...

  9. sjw-风评评测-定位页面元素

    一.手工标准化操作流程: 1.登录系统 2.登录后的页面点击:账户设置 3.点击“重新评测”,进入到风险评测页面 4.答完8道题 5.勾选条件checkbox 6.点击“提交” 提交后的页面 二.自动 ...

  10. python内置函数值 -- chr() ord()

    chr()接收一个数字, 找到这个数字对应的ascii里的元素(只能接受数字) a = chr(65) print(a) #结果: A ord()接收一个字符,返回这个字符对应的数字.(只能接受一个字 ...