发表于: 2016-12-21 00:20:10
2 1747
今天完成的事情:配置了nginx跨域、通过ui-router、route两种方法实现了前端路由、制作了任务七列表页的主体、学习了正则的前瞻、对象属性、分组排序等
明天计划的事情:使用$http请求列表页数据、并渲染到空页面上,用postman测试接口是否畅通、看完angular的基础语法
遇到的问题:配置nginx和写html文件时因为粗心,错写ng-view成ui-view,导致页面崩溃和跳转不显示页面内容。
收获:
.config(function ($routeProvider) {
$routeProvider.
when('/home', {
templateUrl: 'embedded.home.html',
controller: 'HomeController' }).
when('/about', {
templateUrl: 'embedded.about.html',
controller: 'AboutController' }).
otherwise({
redirectTo: '/home' });
});
$urlRouterProvider.otherwise("/state1");
$stateProvider
.state('state1', {
url: "/state1",
templateUrl: "state1.html"
})
.state('state2', {
url: "/state2",
templateUrl: "state2.html"
})
});
评论