angularjs路由错误的链接

时间:2015-10-27 11:21:36

标签: angularjs cordova angular-routing

我正在使用cordova angularjs。我将使用routeprovider。 index.js:

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

appGenerator.config(function ($compileProvider) {
    $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|tel):/);
});

        appGenerator.config(['$routeProvider' function ($routeProvider) {

         $routeProvider
             .when('/', {
                templateUrl: "partials/tablePage.html",
                 controller: "MainCtrl"
             })
             .when('/contacts', {
                 templateUrl: "partials/contacts.html",
                 controller: "ContactsCtrl"
            }).otherwise({
                 redirectTo: '/'
             }); }]);

HTML:

<a href="#/{{table.tablename}}" onclick="callTable()">{{table.tablename}}</a>

但我收到net::ERR_FILE_NOT_FOUND(file:///contacts)错误

我做错了什么?

0 个答案:

没有答案