javascript - Load JQuery where it's needed in AngularJS project -
i have animated 404 error page created using jquery.
the make work angularjs project if had jquery.min.js, 404.js, 404.min.css , javascript script tag in index.html however, creates unnecessary loading on other pages , slows down website.
i found https://github.com/manuelmazzuola/angular-ui-router-styles looks it's designed css stylesheets or can use include js files too?
how should load js, css files on partials, 404.html file , not on index.html?
i think looking lazy loading.
normally, javascript pertains web page or application loaded during page load.
lazy loading loading code once user needs it. if have button on page show different screen user once pressed,
require js serve purpose , clean.
take @ below code project
$('#somebutton').on('click', function() { require( ['every', 'javascript', 'dependency', 'for', 'other', 'screen'], function(ev, js, dep, fr, othr, scrn){ // create screen dependencies } ); });
Comments
Post a Comment