Created
August 31, 2015 13:22
-
-
Save xdemocle/1ad374d2be98e1ad15f5 to your computer and use it in GitHub Desktop.
Encapsulated JS Scripts examples
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
/** | |
* Encapsulated JS Scripts | |
*/ | |
(function (window, angular, Hammer) { | |
'use strict'; | |
function exampleFunction (element) { | |
return 'something'; | |
} | |
})(this, this.angular, this.Hammer); | |
/** | |
* Example with window instead of this | |
*/ | |
(function (window, angular, Hammer) { | |
'use strict'; | |
function exampleFunction (element) { | |
return 'something'; | |
} | |
})(window, window.angular, window.Hammer); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment