Skip to content

Instantly share code, notes, and snippets.

@xcarpentier
Created October 26, 2014 14:35
Show Gist options
  • Save xcarpentier/5c6cd258257adfe13f2f to your computer and use it in GitHub Desktop.
Save xcarpentier/5c6cd258257adfe13f2f to your computer and use it in GitHub Desktop.
// à l'intérieure de la définition d'une directive
function outer() {
return {
controller: DashboardPanel,
};
DashboardPanel.$inject = ['logger']; // l'injection ne fonctionne pas après le return
function DashboardPanel(logger) {
}
}
// à l'intérieure de la définition d'une directive
function outer() {
DashboardPanel.$inject = ['logger']; // injection réussie
return {
controller: DashboardPanel,
};
function DashboardPanel(logger) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment