Created
August 22, 2014 15:48
-
-
Save karlwestin/a19c6bc149190af2a0eb to your computer and use it in GitHub Desktop.
Access components using the angular.js injector
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// When you bootstrapped your app manually, | |
// angular.bootstrap returns the injector for the app: | |
var myApp = angular.boostrap(element, "app"); | |
// Now you can require modules that's been | |
// defined and play around with them separately | |
var myApp = rfzApp.get("app.services.confirm"); | |
confirm("Details were saved"); | |
// To see more what you can do with the injector (the rfzApp object) | |
// Check here: | |
// https://code.angularjs.org/1.2.19/docs/api/auto/service/$injector | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment