Last active
August 29, 2015 14:00
-
-
Save clonn/11283289 to your computer and use it in GitHub Desktop.
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
app = angular.module("myApp", ["service.create"]) |
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
angular.module("myApp").controller("testCtrl", function($scope, create) { | |
return console.log(create); | |
}); |
I will use
angular.module("myApp", ["myApp.controllers", "myApp.services"]);
angular.module("myApp.controllers", ["ui.router"]);
angular.module("myApp.services", ["ui.bootstrap"]);
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
app = angular.module("myApp", ["service.create"])
defines a module here, the "myApp" module dependencies is defined here and cannot be changed. It's dependencies is ["service.create"].
Later, you call
angular.module("myApp")
to just get the "instance" of that module. It's the same one with previous 'app'. You cannot add dependencies here since it'll create another new module and override "myApp"