Angular module config not called

后端 未结 3 918
失恋的感觉
失恋的感觉 2020-12-29 04:48

I\'m trying to get my head around AngularJS and ran into a problem.

var myApp = angular.module(\'myApp\', [\'myApp.services\']);

myApp.config([\'$routeP         


        
3条回答
  •  南方客
    南方客 (楼主)
    2020-12-29 05:24

    I usually see routing applied by chaining them together:

    $routeProvider
        .when('/dashboard', {templateUrl: 'partial/dashboard', controller: DashboardController})
        .when('/menu', {templateUrl: 'partial/other', controller: OtherController})
        .otherwise({redirectTo: '/dashboard'});
    

    Can't see why yours would not work, but might be worth a go.

提交回复
热议问题