mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +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);
|
||||
}
|
||||
};
|
||||
}).
|
||||
|
||||
});
|
||||
|
||||
// New injector is created from the module.
|
||||
// (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
|
||||
var greeter = injector.get('greeter');
|
||||
|
|
|
|||
Loading…
Reference in a new issue