Created
June 6, 2016 11:50
-
-
Save Donmclean/6f3cb24da65ba70a6c5f507ec43a7c01 to your computer and use it in GitHub Desktop.
Properly integrate non-AngularJS libraries in your AngularJS application
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function LodashFactory($window) { | |
| if(!$window._){ | |
| // If lodash is not available you can now provide a | |
| // mock service, try to load it from somewhere else, | |
| // redirect the user to a dedicated error page, ... | |
| } | |
| return $window._; | |
| } | |
| // Define dependencies | |
| LodashFactory.$inject = ['$window']; | |
| // Register factory | |
| yourModule.factory('_', LodashFactory); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Where do i need to include de script tag reference to the library??