search

Home  >  Q&A  >  body text

angular.js - AngularJS中的$scope的作用相当于android中的适配器一样,这种描述准确吗?

$scope是视图和控制器之间的桥梁,而适配器是视图与数据之间的桥梁,但是控制器这个扮演什么角色不太清楚,故有这种疑问

伊谢尔伦伊谢尔伦2744 days ago514

reply all(1)I'll reply

  • 巴扎黑

    巴扎黑2017-05-15 17:08:37

    Sorry I have never done Android, but according to your description of the Android adapter, it feels like the controller acts as a bridge between the view and the data.
    angular is a framework with MVVM structure. The ViewModel layer acts as a bridge between views and data.

    The two-way arrow refers to two-way binding. ViewModel is the main body of our daily code processing.

    reply
    0
  • Cancelreply