发表于: 2017-05-14 20:35:24

2 977


今天完成的事情:

找到一个博客介绍angular常用功能看看

 
明天计划的事情:

开始整合页面

 
遇到的问题: 
数据无法获取,询问师兄


收获:

解决昨天的遗留问题

这个错误除了书写格式和接口的错误外,还重复引用ng-app,这个指令只应该出现一次

               路由的具体写法

  1. app.config(function($stateProvider,$urlRouterProvider){  
  2.     $urlRouterProvider.otherwise("/index");//未定义的页面显示还是需要ngRoute的otherwise成员方法定义  
  3.     $stateProvider.state('index', {//index为请求的地址  
  4.            url: '/index',// 这里的/index为设置在浏览器#后面显示的地址  
  5.            views: {  
  6.                '': {//空为主ui-view模块  
  7.                    templateUrl: 'tpls/home.html'//模板地址  
  8.                },  
  9.                'main@index': {//这个是设置嵌套在index里面名为main的ui-view  
  10.                    templateUrl: 'tpls/loginForm.html'//模板地址  
  11.                }  
  12.            }  
  13.        }).state("index.page",{//对应的路由为/index/page  
  14.         url:"/page",  
  15.         views:{  
  16.               
  17.         }  
  18.        })  
  19. });  



返回列表 返回列表
评论

    分享到