docs(cheatsheet): copy edit class-decorators.md (#11154)

No copy edits to this one, but I removed Dart-specific code, since the
Dart cheatsheet is produced
from dart-lang/angular2.
This commit is contained in:
Kathy Walrath 2016-08-29 18:13:10 -07:00 committed by Victor Berchet
parent d59ee3caaa
commit f9f80003c8

View File

@ -4,7 +4,6 @@ Class decorators
@description @description
{@target ts}`import { Directive, ... } from '@angular/core';`{@endtarget} {@target ts}`import { Directive, ... } from '@angular/core';`{@endtarget}
{@target js}Available from the `ng.core` namespace{@endtarget} {@target js}Available from the `ng.core` namespace{@endtarget}
{@target dart}`import 'package:angular2/core.dart';`{@endtarget}
@cheatsheetItem @cheatsheetItem
syntax(ts): syntax(ts):
@ -12,9 +11,6 @@ syntax(ts):
class MyComponent() {}`|`@Component({...})` class MyComponent() {}`|`@Component({...})`
syntax(js): syntax(js):
`var MyComponent = ng.core.Component({...}).Class({...})`|`ng.core.Component({...})` `var MyComponent = ng.core.Component({...}).Class({...})`|`ng.core.Component({...})`
syntax(dart):
`@Component(...)
class MyComponent() {}`|`@Component(...)`
description: description:
Declares that a class is a component and provides metadata about the component. Declares that a class is a component and provides metadata about the component.
@ -24,9 +20,6 @@ syntax(ts):
class MyDirective() {}`|`@Directive({...})` class MyDirective() {}`|`@Directive({...})`
syntax(js): syntax(js):
`var MyDirective = ng.core.Directive({...}).Class({...})`|`ng.core.Directive({...})` `var MyDirective = ng.core.Directive({...}).Class({...})`|`ng.core.Directive({...})`
syntax(dart):
`@Directive(...)
class MyDirective() {}`|`@Directive(...)`
description: description:
Declares that a class is a directive and provides metadata about the directive. Declares that a class is a directive and provides metadata about the directive.
@ -36,9 +29,6 @@ syntax(ts):
class MyPipe() {}`|`@Pipe({...})` class MyPipe() {}`|`@Pipe({...})`
syntax(js): syntax(js):
`var MyPipe = ng.core.Pipe({...}).Class({...})`|`ng.core.Pipe({...})` `var MyPipe = ng.core.Pipe({...}).Class({...})`|`ng.core.Pipe({...})`
syntax(dart):
`@Pipe(...)
class MyPipe() {}`|`@Pipe(...)`
description: description:
Declares that a class is a pipe and provides metadata about the pipe. Declares that a class is a pipe and provides metadata about the pipe.
@ -49,11 +39,8 @@ class MyService() {}`|`@Injectable()`
syntax(js): syntax(js):
`var OtherService = ng.core.Class({constructor: function() { }}); `var OtherService = ng.core.Class({constructor: function() { }});
var MyService = ng.core.Class({constructor: [OtherService, function(otherService) { }]});`|`var MyService = ng.core.Class({constructor: [OtherService, function(otherService) { }]});` var MyService = ng.core.Class({constructor: [OtherService, function(otherService) { }]});`|`var MyService = ng.core.Class({constructor: [OtherService, function(otherService) { }]});`
syntax(dart):
`@Injectable()
class MyService() {}`|`@Injectable()`
description: description:
{@target ts dart}Declares that a class has dependencies that should be injected into the constructor when the dependency injector is creating an instance of this class. {@target ts}Declares that a class has dependencies that should be injected into the constructor when the dependency injector is creating an instance of this class.
{@endtarget} {@endtarget}
{@target js} {@target js}
Declares a service to inject into a class by providing an array with the services with the final item being the function which will receive the injected services. Declares a service to inject into a class by providing an array with the services with the final item being the function which will receive the injected services.