Skip to content

Instantly share code, notes, and snippets.

@karlwestin
Created August 22, 2014 15:48
Show Gist options
  • Save karlwestin/a19c6bc149190af2a0eb to your computer and use it in GitHub Desktop.
Save karlwestin/a19c6bc149190af2a0eb to your computer and use it in GitHub Desktop.
Access components using the angular.js injector
// 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