Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在AngularJS中不工作的路线_Javascript_Angularjs_Ngroute - Fatal编程技术网

Javascript 在AngularJS中不工作的路线

Javascript 在AngularJS中不工作的路线,javascript,angularjs,ngroute,Javascript,Angularjs,Ngroute,我是Angular的新手,无法在应用程序中使用路由。我有嵌套的模块,这让我认为问题在于注射,但我希望有人能把我从沮丧的日子里救出来 模块定义如下: angular.module('accountManagement').config(['$routeProvider', function($routeProvider){ alert("hello"); $routeProvider .when('/accounts/:accountId', { t

我是Angular的新手,无法在应用程序中使用路由。我有嵌套的模块,这让我认为问题在于注射,但我希望有人能把我从沮丧的日子里救出来

模块定义如下:

angular.module('accountManagement').config(['$routeProvider',     function($routeProvider){
    alert("hello");
    $routeProvider
    .when('/accounts/:accountId', {
        templateUrl:  'administrator/account_management/views/view_account.client.view.html'
    });
}]);
application.js

 'use strict';
    var mainApplicationModuleName = 'vre';
    var mainApplicationModule = angular.module(mainApplicationModuleName,     ['ngResource', 'ngRoute', 'main']);
    mainApplicationModule.config(['$locationProvider',
            function($locationProvider){
                $locationProvider.hashPrefix('!');
            }
    ]);
    if(window.location.hash === '#_=_'){
        window.location.hash = '#!';
    }
    angular.element(document).ready(function(){
         angular.bootstrap(document, [mainApplicationModuleName]);
    });
主模块

angular.module('main', ['administrator']);
管理员配置文件

 'use strict';
    angular.module('administrator', ['accountManagement']);
帐户管理模块

 'use strict';
    angular.module('accountManagement', ['ngRoute']);
然后,路由如下所示:

angular.module('accountManagement').config(['$routeProvider',     function($routeProvider){
    alert("hello");
    $routeProvider
    .when('/accounts/:accountId', {
        templateUrl:  'administrator/account_management/views/view_account.client.view.html'
    });
}]);
我会弹出警报,但当我转到url时,我得到的只是: 无法获取/accounts/55889e12c02081fc20de1bdd

非常感谢您的帮助

Ash

我认为url必须是


别忘了你是有史以来最伟大的人,而我,我是个白痴!