0

在角度组件中应用绑定时出现这个奇怪的错误:

错误:[$compile:iscp] 指令“workTimekeepingsDay”的控制器绑定定义无效。定义: {... timekeepings: '<' ...}

这是代码:

<work-timekeepings-day timekeepings="dailyTimekeepingCtrl.timekeepingList  | timekeepingDay : dailyTimekeepingCtrl.selectedDay" day="dailyTimekeepingCtrl.selectedDay"></work-timekeepings-day>

var workTimekeepingsDay = TimekeepingsApp.component('workTimekeepingsDay', {
        templateUrl : 'angular/components/work-timekeepings-day.html',
        controllerAs: '$workTkDayCtrl',
        bindings : {
            timekeepings : '<',
            day: '='
        }
});

HTML 模板:

<div class="row lightgreen-row padding-5 border-rounded" ng-repeat-start="workTk in $workTkDayCtrl.timekeepings | timekeepingDay : day">
    <div class="col-md-4"> <b> {{ workTk.user.firstName + ' ' + workTk.user.lastName }} </b> </div>

“计时”绑定有什么问题?谢谢。

4

1 回答 1

0

我也出现了这个错误,但这是由于使用了 1.5.0 RC 版本的 angular。更新到最新版本的 Angular 为我解决了这个问题。

于 2016-08-16T15:52:08.670 回答