docs(cheatsheet): update to new syntax

See https://github.com/angular/angular.io/pull/459

Closes #5733
This commit is contained in:
Peter Bacon Darwin
2015-12-09 12:33:42 +00:00
committed by Pete Bacon Darwin
parent ca73852746
commit 2f0744b089
11 changed files with 120 additions and 5 deletions

View File

@ -5,16 +5,22 @@ Dependency injection configuration
`import {provide} from 'angular2/angular2';`
@cheatsheetItem
`provide(MyService, {useClass: MyMockService})``provide`|`useClass`
syntax:
`provide(MyService, {useClass: MyMockService})`|`provide`|`useClass`
description:
Sets or overrides the provider for MyService to the MyMockService class.
@cheatsheetItem
`provide(MyService, {useFactory: myFactory})``provide`|`useFactory`
syntax:
`provide(MyService, {useFactory: myFactory})`|`provide`|`useFactory`
description:
Sets or overrides the provider for MyService to the myFactory factory function.
@cheatsheetItem
`provide(MyValue, {useValue: 41})``provide`|`useValue`
syntax:
`provide(MyValue, {useValue: 41})`|`provide`|`useValue`
description:
Sets or overrides the provider for MyValue to the value 41.