【发布时间】:2015-11-13 05:49:17
【问题描述】:
我正在尝试将我在 html 上的引导文件转移到使用流星实现。我希望所有内容都在单独的页面上,但是即使我通过 angular-ui-router 路由文件,我的程序也会在一页上显示我的所有页面。这是我放置在根/客户端文件夹中的 routes.js 文件:
angular.module("project").config(['$urlRouterProvider', '$stateProvider', '$locationProvider',
function($urlRouterProvider, $stateProvider, $locationProvider){
$locationProvider.html5Mode(true);
$stateProvider
.state('aboutus', {
url: '/aboutus',
templateUrl: 'client/views/about.html',
})
.state('contactus',{
url: '/contactus',
templateUrl: 'client/views/contact.html',
})
.state('home', {
url: '/home',
templateUrl: 'client/views/index.html',
})
.state('services', {
url: '/services',
templateUrl: 'client/views/services.html',
})
$urlRouterProvider.otherwise("/home");
}]);
如果你想查看整个项目,这里是: https://github.com/Aggr0vatE/project
【问题讨论】:
-
问题是?
-
我正在努力做到这一点,以便有多个路线而不是所有内容都显示在一个页面上
标签: javascript angularjs twitter-bootstrap meteor