src/app/home/foo.component.ts
This component is used for testing that things like change detection still work when dealing with various aspects of the angular view system,
selector | foo |
Properties |
Inputs |
Accessors |
cnt
|
Type:
Default value: |
Defined in src/app/home/foo.component.ts:15
|
inc
|
Type: |
Defined in src/app/home/foo.component.ts:17
|
counter |
counter:
|
Default value : 0
|
Defined in src/app/home/foo.component.ts:14
|
inc | ||||||||
setinc(num: number)
|
||||||||
Defined in src/app/home/foo.component.ts:17
|
||||||||
Parameters :
Returns :
void
|
import { Component, Input } from "@angular/core";
/**
* This component is used for testing
* that things like change detection still
* work when dealing with various aspects
* of the angular view system,
*/
@Component({
selector: 'foo',
template: `<span>{{cnt}}</span>`
})
export class FooComponent {
counter = 0;
@Input() cnt: number = 0;
@Input() set inc(num: number) {
console.log('received inc');
this.counter++;
}
}