Background: Collaboration between angular and jquery class library
In the third-party library, we have to mention the famous jquery, which is now basically a compulsory tool for domestic web development. Its flexible dom operation makes many web developers unable to stop. Coupled with the already mature jquery UI library and a large number of jquery plug-ins, it is almost an inexhaustible treasure house. However, can it be combined with angularjs?
Many angularjs fundamentalists are negative about this. They believe that since angularjs has been used as the web application framework, it is necessary to avoid interference from other class libraries and make pure MvvM mode applications. Any dom operation similar to jquery is unclean. Put all interface-related operations, such as dom operations, in directive, so that the page is directive without code, which is consistent with JSF's idea. MVVM, DSL, componentization ideas are the trend of the web. Well, the idea is good, fundamentalists are so pure. But the fact is that when we use angularjs, we cannot do without jquery.
As we all know, jquery lite. is actually built into angularjs, and many methods in the angularjs source code are directly used to use jquery methods. For example, the event binding mechanism of angularjs. Since the prophets are all using it, why don’t we use it? There is nothing wrong with the idea of componentization, but there is no need to tie your hands and feet because of this. The only thing to note is not to use jquery's code to destroy the structure of angularjs. (Original link: http://www.angularjs.cn/A0fG)
Case: Encapsulate the time plugin of the official bootstrap website in angular
Instructions for use:
Add ng-model='timepickerTest' ng-time on the html fragment of the original bootstrap-datetimepicker
The storage address of the code on github: https://github.com/cynthiawupore/ui-bootstrap-datetimepicker
If you still want to study in depth, you can click here to study and attach 3 exciting topics to you:
Bootstrap learning tutorial
Bootstrap practical tutorial
Bootstrap plug-in usage tutorial
The above is all the content of this article. I hope it will be helpful to everyone's learning and I hope everyone will support Wulin.com more.