Decorator

toBoolean, @InputBoolean

Convert to boolean, @InputBoolean() can enhance the experience of binding number attributes, for example:

@Input() @InputBoolean() disabled = false;

The following calling methods will all be considered effective:

<test disabled></test> // true
<test disabled="true"></test> // true
<test [disabled]="true"></test> // true
<test disabled="false"></test> // false
<test [disabled]="false"></test> // false

toNumber, @InputNumber

Convert to number, @InputNumber() can enhance the experience of binding number attributes, for example:

@Input() @InputNumber() count = 10;

The following calling methods will all be considered effective:

<test count="1"></test> // 1
<test [count]="1"></test> // 1

@ZoneOutside

The decoration method runs in runOutsideAngular.

class MockClass {
  constructor(public ngZone: NgZone) {}

  @ZoneOutside()
  run(): void {}
}

@ZoneRun

The decoration method runs in run.

class MockClass {
  constructor(public ngZone: NgZone) {}

  @ZoneRun()
  run(): void {}
}