0
var testApp = angular.module('testApp', ['firebase'])
.config(['$routeProvider','$locationProvider',function ($routeProvider,$locationProvider) {

$routeProvider

 .when('/test', {
    templateUrl: '/views/test.html',
    controller: 'TestCtrl',
    resolve:
    {
        loaddata: testCtrl.loaddata
    }
      });
    }]);

var testCtrl = testApp.controller('TestCtrl',['$scope', function  ($scope) {

}]);

testCtrl.loaddata = function($scope) {



    return promise;

}

问题是我不能在这里注入 $scope: testCtrl.loaddata = function($scope) {

如何在解析函数中获取 $scope?

4

0 回答 0