angular.js - 前端mvc的困难,angular是如何解决的呢?
某草草
某草草 2017-05-15 17:04:26
0
1
479

困难1.操作dom的代码必须等待整个页面全部加载完成

控制器不操作dom,dom操作使用指令来完成,这是加载完才操作dom的保证嘛?

困难2:js的原型继承也给前端编程带来很多困难
js原型继承的痛点是什么?是 http://www.jb51.net/article/57287.htm这里所提到的子类由于和父类共享原型,导致子类修改原型的同时,父类被乱改的问题嘛?
angular 中如何规避这个痛点的?$scope在解决痛点上是否发挥了作用,发挥了什么作用?

某草草
某草草

reply all(1)
迷茫

What I understand is: the two things you mentioned seem to have nothing to do with Angularjs.
The controller can also operate the dom, but it is not recommended. Angularjs doesn't do anything to enforce it.
For prototypal inheritance, it can be used or not. The main thing is to standardize the code style.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!