Open qria opened 9 years ago
var ApplicationConfiguration = (function() { // Init module configuration options var applicationModuleName = 'app'; var applicationModuleVendorDependencies = ['ngResource', 'ngAnimate', 'ui.router', 'ui.bootstrap', 'ui.utils','timer'];
// Add a new vertical module
var registerModule = function(moduleName, dependencies) {
// Create angular module
angular.module(moduleName, dependencies || []);
// Add the module to the AngularJS configuration file
angular.module(applicationModuleName).requires.push(moduleName);
};
return {
applicationModuleName: applicationModuleName,
applicationModuleVendorDependencies: applicationModuleVendorDependencies,
registerModule: registerModule
};
})(); You Could Register Module like the above . Or you may Inject the time Module directly in your Controllers
Had my main module named 'app', loaded this module, and literally everything broke.
I solved it by wrapping everything except timerModule part in closure. (I excluded timerModule because I wasn't sure it wouldn't break anything)
Maybe wrap everything possible in to a closure?
I know, I probably shouldn't have named my app 'app', but still, I think it'll be better to not use root namespace as much as we can.