Skip to content

Instantly share code, notes, and snippets.

@petebacondarwin
Created December 8, 2015 08:17
Show Gist options
  • Save petebacondarwin/59767c27a7bf11f8134b to your computer and use it in GitHub Desktop.
Save petebacondarwin/59767c27a7bf11f8134b to your computer and use it in GitHub Desktop.

@cheatsheetSection Class decorators @cheatsheetIndex 4 @description {@target ts js}import {Directive, ...} from 'angular2/angular2';{@endtarget} {@target dart}import 'package:angular2/angular2.dart';{@endtarget}

@cheatsheetItem syntax(ts js): @Component({...}) class MyComponent() {}|@Component({...}) syntax(dart): @Component(...) class MyComponent() {}|@Component(...) description: Declares that a class is a component and provides metadata about the component.

@cheatsheetItem syntax(ts js): @Pipe({...}) class MyPipe() {}|@Pipe({...}) syntax(dart): @Pipe({...}) class MyPipe() {}|@Pipe({...}) description: Declares that a class is a pipe and provides metadata about the pipe.

@cheatsheetItem syntax: @Injectable() class MyService() {}|@Injectable() description: Declares that a class has dependencies that should be injected into the constructor when the dependency injector is creating an instance of this class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment