Open alexleone opened 9 years ago
It's pretty straightforward:
basket.require({url:"<url-to-script>", unique:"cache-buster-string"}, ...).then(function() {
$(document).ready(function() {
angular.bootstrap(document, ['app-name']);
});
});
^ goes in the page head, and you have to remove the ng-app directive from w/e you currently have it.
Other than having to manually bootstrap angular, the two libraries don't affect each other.
EDIT: You could also just give it a unique file name (which is what it sounds like you are doing), but then it would keep multiple versions of the script in localStorage until each one expires instead of replacing the old version with the new version.
Thanks for the response let me try this out.
Has anyone had any experience integrating basket into an angular app?
Currently I am using bower and grunt to configure my build of the app. When I run a build for my app the grunt module use a Gruntfile to go through a series of tasks that take all the JS files concatenates, minifies, and add a cache buster file name.
Now I do not have an experience with Basket.js but I think it would be great to use in my project and was wondering if anyone had an experience with this already? Or have an idea of how I can integrate basket into the grunt build process.