Created
July 14, 2014 21:20
-
-
Save simonrobb/ba264b3c0b8dad9971c5 to your computer and use it in GitHub Desktop.
This file contains 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
var myModule; | |
try { | |
// try to get a previously created module | |
myModule = angular.module('myModule'); | |
} catch { | |
// an error is thrown if it doesn't exist. create it now | |
myModule = angular.module('myModule', []); | |
} | |
// the rest of your code | |
myModule.controller(function () {}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment