在Angular“Todo App”教程中,官方
meteor.com网站的构造函数中有:
$scope.viewmodel(this);
在angular-meteor.com的“社交”教程中,看起来完全相同的事情是:
$reactive(this).attach($scope)
有什么不同?
好的,所以我做了一些关于这个问题的研究,这是我发现的.
原文链接:https://www.f2er.com/angularjs/141965.html关于$reactive(this).attach($scope):
“$reactive is a service that takes care of the reactivity of your
Meteor data,and updates your AngularJS code.”“This service wraps context (can be used with this or $scope) – so you
can use it with any context as you wish.”
阅读有关它的详细信息here.
关于$scope.viewmodel(this):
它看起来像是一个包,一个库:
“viewmodel is a view layer for Meteor. You can think of it as Angular,
Knockout,Aurelia,Vue,etc. but without the boilerplate code required
to make those work.”
关于它的更多信息here.