我们如何强制使用$scope.meteorSubscribe
创建的Meteor订阅重新加载?
我找到的唯一方法是将一个反应变量传递给$scope.meteorSubscribe
,并在我想强制重新订阅时更改此反应变量。对我来说似乎不是一个好的解决方案,特别是当这个变量可能是一个庞大的数组时。
有没有更合适的方法?
$meteor.autorun($scope, function() {
$scope
.$meteorSubscribe(
'favoriteFruits',
Session.get('favorites') // this is the reactive variable that we need to pass in
)
.then(function() {
$scope.favFruits = $scope.$meteorCollection(Fruits, false)
})
})