mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-20 12:21:52 +00:00
docs(guide): fix injector service code example
Fix syntax and update code to the latest API
This commit is contained in:
parent
c398d7d370
commit
a66c968df2
1 changed files with 3 additions and 3 deletions
|
|
@ -67,11 +67,11 @@ Here is an example of using the injector service.
|
||||||
$window.alert(text);
|
$window.alert(text);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}).
|
});
|
||||||
|
|
||||||
// New injector is created from the module.
|
// New injector is created from the module.
|
||||||
// (This is usually done automatically by angular bootstrap)
|
// (This is usually done automatically by angular bootstrap)
|
||||||
var injector = angular.injector('myModule');
|
var injector = angular.injector(['myModule', 'ng']);
|
||||||
|
|
||||||
// Request any dependency from the injector
|
// Request any dependency from the injector
|
||||||
var greeter = injector.get('greeter');
|
var greeter = injector.get('greeter');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue