I fount out in the official angularjs documents that
angular.module('foo', [])
makes the definition of foo module, and
angular.module('foo')
is calling (not making) foo module.
But I could not start my app when I wrote the code below,
app/controllers/file1.js
var app = angular.module('app.controller', []);
app/controllers/file2.js
var app = angular.module('app.controller');
and, it worked when I only changed those two declarations:
app/controllers/file1.js
var app = angular.module('app.controller');
app/controllers/file2.js
var app = angular.module('app.controller', []);
so... I am wondering that
- how the order of loading module is decided
- how should I do when I want to use same module on two or more files
Thanks.