加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angular-meteor – $reactive(this).attach($scope)和$scope.vie

发布时间:2020-12-17 07:25:58 所属栏目:安全 来源:网络整理
导读:在Angular“Todo App”教程中,官方 meteor.com网站的构造函数中有: $scope.viewModel(this); 在angular-meteor.com的“社交”教程中,看起来完全相同的事情是: $reactive(this).attach($scope) 有什么不同? 好的,所以我做了一些关于这个问题的研究,这是我
在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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读