angular-meteor – $reactive(this).attach($scope)和$scope.viewModel(this)之间的差异

前端之家收集整理的这篇文章主要介绍了angular-meteor – $reactive(this).attach($scope)和$scope.viewModel(this)之间的差异前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在Angular“Todo App”教程中,官方 meteor.com网站的构造函数中有:
$scope.viewmodel(this);

angular-meteor.com的“社交”教程中,看起来完全相同的事情是:

$reactive(this).attach($scope)

有什么不同?

好的,所以我做了一些关于这个问题的研究,这是我发现的.

关于$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.

猜你在找的Angularjs相关文章