无法使用AngularJs导航

时间:2016-03-04 11:59:46

标签: javascript angularjs

您好我的代码似乎很好,但我不知道它为什么不起作用

app.js

var app = angular.module('MyApp', ['ngResource', 'ngRoute']);

app.config(function($routeProvider){

    $routeProvider
    .when('/',{
         templateUrl: '../pages/index1.html'

    }).when('/profile',{
        templateUrl: '../pages/profile.html',


    }).otherwise('',{templateUrl:'index.html'});
 });

的index.html

<li><a data-ng-href="#/profile.html">Profile</a>

0 个答案:

没有答案