I use self invoking functions to include all the javascript code inside an angular controller (I think I saw it somewhere as a best practice). So my controller looks like this:
(function() {
// code
})()
I use gulp to merge all the controllers into one file. My question is this. Does this mean that all of my Javascript code will be invoked and executed when my application starts? If so, I guess that this is not a very good approach. Are there any solutions to that issue? Any comments? Thanks