Closed WellMafra closed 9 years ago
Looks like Config.js is a separate file for you. Where is it being loaded? You should really put the config in the app.js file until #123 is implemented.
My file Config.js is a dependency of the HomeController, this controller is the first controller called in my app. But, if I can not have app.config in separate file, there is no matter. May I have my config in a separate file?
Sorry but I am having a hard time understanding why you need to have app.config in a different file. Can you let me know what are you using this for and maybe I can think of an alternative?
In my case... Just to have each file with each responsibility. But, there is no problem, I'll put my config in app.js More one thing... Just for curiosity: What's the restriction? Can I help you to fix it?
Tks for your time.
The restriction is really educating the user base that config must be ran before the bootstrap or often it is not going to work. If you are dealing with package that can be configure after bootstrap, you can try to call angularAMD.config
.
Yesterday, I had a situation. I putted the config in my app.js
, but I'm using mocks for fakes data.
To config the mock, I have a file, with to many configurations, and the file is big.
To fix the problem, I created a new file to start my application: appMock.js
, just for separate the things, and this file is called in main.js
:
require.config({
...
...
//start app
deps: ['appMock']
});
I didn't like to do that, and its calling app.js yet. Its not calling the appMock.js
I don't know why.
I'll test the angularAMD.config
.
Instead I receive the app
parameter, I'll receive the AngularAMD
? Ex:
Currently Config.js
define(['app'], function(app) {
...
});
Changed Config.js
define(['angularAMD'], function(AngularAMD) {
...
});
Would be this?
I'm having a problem, my app.config is not being called or loaded... I think that the var "app" is not ready, I saw the Issue https://github.com/marcoslin/angularAMD/issues/123, but my configurations about RequireJs is different, follow some parts of my code:
Main.js
App.js
Config.js