2017-04-17 189 views
1

请在plunker上找到我的演示示例。AngularJs路由不能按预期工作

我试着将AdminLTE模板和AngularJs路由结合起来。到目前为止,我所定义的路由规则如常(app.js)

app.config(function ($routeProvider, $locationProvider) { 
    $routeProvider 
     .when("/", { 
      templateUrl: "subpage0.html" 
     }) 
     .when("/subpage1", { 
       templateUrl: "subpage1.html" 
     }) 
     .when("/subpage2", { 
      templateUrl: "subpage2.html" 
     }) 
... 

我设置在我的侧栏(的index.html)

<ul class="nav sidebar-menu"> 
       <li class="active"><a href="#subpage1"><i class="fa fa-circle-o"></i> Menu1</a></li> 
       <li><a href="#subpage2"><i class="fa fa-circle-o"></i> Menu2</a></li> 
       <li><a href="#subpage3"><i class="fa fa-circle-o"></i> Menu3</a></li> 
</ul> 

相应的链接但不幸的是角应用总是路线第一种情况 - > subpage0.html

有什么建议吗?

+0

你能显示你的模块吗? – cnorthfield

+0

@cnorthfield你可以在app.js文件中找到'var app = angular.module('rfidFrontend',[“ngRoute”]);' – d4rty

回答