I feel confused about how angular.injector() get $injector component. As I know, when calling to the angular.injector(['ng', 'app']); will get a new $injector object which is different from the current running Angular app's $injector object.
I made a sample app over here: (Angular 1.3.14)
I'm trying to create a new $injector by using the angular.injector() API. I'd like to get a brand new $injector in order to get "version" service from getVersion function which is outside of the Angular app. I was expected that controller shouldn't be run and shouldn't affect my version service object. I just wanna get the "version" service object only. In my sample, the value for "version" service has a "current" property and it's value is "0.0.1". As you can see, there is a controller called "MainCtrl" that will change the version.current value at controller initialization. When I calling to the getVersion function outside of the Angular app and I created a new $injector object. In that function, I expected that I should get "0.0.1" but it didn't. I've got "0.0.2". I don't know why. Does anyone know?