【发布时间】:2017-08-08 14:12:30
【问题描述】:
我在 Web 应用程序中使用 Meteor 和 angularJS 2。请看下面的发布功能。
Meteor.publish('abc', function () {
// For throwing the meteor error according to the condition
if(!this.userId) throw new Meteor.Error(403,'UnAuthorized error');
// Returning the collection.
return collection.find();
});
现在从 angularjs2 订阅上述出版物时,我正在使用以下代码:-
// 变量声明
this.meteorSubscription = MeteorObservable.subscribe("abc").subscribe(() => {
// Here subscribe data ready, so I called to other method.
});
问题就在这里,我怎么能捕捉到发布功能错误
'throw new Meteor.Error(403,'UnAuthorized error')'
【问题讨论】:
标签: javascript angular meteor angular-meteor