【发布时间】:2016-01-14 21:56:37
【问题描述】:
当我使用“过滤器”加载组件时,“调用”方法在设置“项目”参数之前运行。所以我从第 200 行收到重复错误。最终,“items”被发送,“call”方法运行没有错误。
The null object does not have a method 'where'.
NoSuchMethodError: method not found: 'where'
Receiver: null
Arguments: [Closure: (dynamic) => dynamic]
STACKTRACE:
#0 Object._noSuchMethod (dart:core-patch/object_patch.dart:42)
#1 Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
#2 Filter.call (package:angular/formatter/filter.dart:200:26)
这是我第一次使用 AngularDart 实现过滤器,这发生在我尝试过的两个组件中。我的模板没有什么特别之处:
<tr ng-repeat="appSession in appSessions | orderBy: orderByList | filter: filterObject">
appSessions 列表由属性设置,如果未提供,则在附加方法中设置。在这种情况下,它是由属性设置的。
@NgOneWay("app-sessions") List<AppSessionModel> appSessions;
@NgOneWay("mobile-user-id") int mobileUserID;
void attach() {
if (appSessions == null) {
if (mobileUserID != null) {
appSessionManager.getForUser(mobileUserID).then((sessions) {
appSessions = sessions;
});
} else if (!fromUserTable) {
appSessionManager.getOpen().then((sessions) {
appSessions = sessions;
});
}
}
}
有其他人经历过吗?这里有时间错误吗?
谢谢, 山姆
【问题讨论】:
-
您能添加更多代码吗?值是如何设置的?
-
@GünterZöchbauer 我添加了设置“appSessions”的代码。据我所知,没有什么不寻常的。我有另一个组件,其中列表包含地图,而不是对象,但我仍然收到此错误。
标签: dart angular-dart