locked
Bootstrap's JavaScript requires jQuery RRS feed

  • Question

  • User-1771888428 posted

    I receive this error for Both Bootstrap and for Angular Modal service that I use (Modal service not loading without full jquery).

    Now, I don't want to include a +100KB Full jquery to only run BootStrap.js or Modal service and I don't think these libraries require full jquery, they may not find Anguarjs included JqLite so how do I force them to find jqLite that included with angular js, (Note: I included angularjs first)

    Sunday, February 28, 2016 6:20 PM

All replies

  • User-474980206 posted

    you can get jQuery based libraries to work by defining $:

       window.$ = angular.element

    you would also need to pollyfill jQuery functions used in the library. say $.ready(). also as bootstrap uses namespaced events, you would need to update the event model, and change jqlite's "on" method to support namespaced events.

    a simpler approach if you don't want jQuery, is to only use the bootstrap CSS files and find an alternate implementation of the components. say:

    https://github.com/angular-ui/bootstrap


      

    Monday, February 29, 2016 6:08 PM