AngularJS: Understanding design pattern

前端 未结 5 1616
逝去的感伤
逝去的感伤 2020-11-28 17:17

In the context of this post by Igor Minar, lead of AngularJS:

MVC vs MVVM vs MVP. What a controversial topic that many developers

5条回答
  •  悲哀的现实
    2020-11-28 17:28

    To be crisp about the question, Angular uses different design patterns which we already encountered in our regular programming. 1) When we registers our controllers or directives, factory, services etc with respect to our module. Here it is hiding the data from the global space. Which is Module pattern. 2) When angular uses its dirty checking for comparing the scope variables, here it uses Observer Pattern. 3) All the parent child scopes in our controllers uses Prototypal pattern. 4) In case of injecting the services it uses Factory Pattern.

    Overall it uses different known design patterns to solve the problems.

提交回复
热议问题