Angularjs 角度链接范围变量未定义到模板中

Angularjs 角度链接范围变量未定义到模板中,angularjs,angularjs-directive,angularjs-scope,Angularjs,Angularjs Directive,Angularjs Scope,我定义了一个使用ui.calendar作为子指令的指令: angular.module('calendar.availability') .directive('calendarAvailability', ['$http','$modal','$log', function($http,$modal,$log) { return { restrict: 'E' , replace: true , template: '<di

我定义了一个使用ui.calendar作为子指令的指令:

angular.module('calendar.availability')
.directive('calendarAvailability', ['$http','$modal','$log', function($http,$modal,$log) {
        return {
        restrict: 'E'
        , replace: true
        , template: '<div><div ui-calendar="uiConfig.calendar" ng-model="eventsources"></div></div>'
        , scope: {
             availability: '=',
             delegation: '='
        }
        , link: function($scope, elm, attrs, ctrl) {
            $scope.eventsources=[];
            var removeAvailabilitySkeleton = function() {
                $scope.eventsources[0] = [];
            };
            $scope.$watch('availability', function(n, o) {
               if (n == o) return;
               removeAvailabilitySkeleton();
               if (n == 0) return;
               $http.get('ws/availability.php', {params: {doctor: $scope.availability,delegation: $scope.delegation}})
                .success(function(xhr) {
                $scope.eventsources[0] = xhr;
               });
            });
            //........... event handlers

            $scope.uiConfig = {
            calendar: {
                editable: true,
                selectable: true,
                selectHelper: true,
                weekends: false,
                defaultView: 'agendaWeek',
                unselectCancel: '.eventeditor',
                allDaySlot: false,
                slotEventOverlap: false,
                dayNames: ['domingo', 'lunes', 'martes', 'miercoles', 'jueves', 'viernes', 'sabado'],
                dayNamesShort: ['dom', 'lun', 'mar', 'mie', 'jue', 'vie', 'sab'],
                header: {
                left: 'month agendaWeek agendaDay',
                center: 'title',
                right: 'today prev,next'
                },
                dayClick: $scope.alertEventOnClick,
                eventDrop: $scope.alertOnDrop,
                eventResize: $scope.alertOnResize,
                select: $scope.selectRange
            }
            };
        }

        }
    }])
angular.module('calendar.availability')
.directive('calendarAvailability'、['$http'、'$modal'、'$log',函数($http、$modal、$log){
返回{
限制:“E”
,替换为:true
,模板:“”
,范围:{
可用性:'=',
代表团:'='
}
,链接:函数($scope、elm、attrs、ctrl){
$scope.eventsources=[];
var removavailabilityskeleton=函数(){
$scope.eventsources[0]=[];
};
$scope.$watch('可用性'),功能(n,o){
如果(n==o)返回;
removeAvailabilitySkeleton();
如果(n==0)返回;
$http.get('ws/availability.php',{params:{doctor:$scope.availability,delegation:$scope.delegation})
.成功(功能(xhr){
$scope.eventsources[0]=xhr;
});
});
//事件处理程序
$scope.uiConfig={
日历:{
是的,
是的,
selectHelper:对,
周末:错,
defaultView:'agendaWeek',
取消选择取消:'.eventeditor',
全天时段:错,
slotEventOverlap:错误,
日名:[“多明戈”、“伦斯”、“马蒂斯”、“米尔科勒”、“朱维斯”、“维也纳”、“萨巴多”],
dayNamesShort:['dom'、'lun'、'mar'、'mie'、'jue'、'vie'、'sab'],
标题:{
左:'month agendaWeek agendaDay',
中心:'标题',
右图:“今天上一个,下一个”
},
dayClick:$scope.alertEventOnClick,
eventDrop:$scope.alertOnDrop,
eventResize:$scope.alertOnResize,
选择:$scope.selectRange
}
};
}
}
}])
问题是,在渲染时,子指令ui.calendar找不到ng模型eventsources(未定义)并抛出错误。 任何帮助都是值得的

可能重复的