File

src/app/home/foo.component.ts

Description

This component is used for testing that things like change detection still work when dealing with various aspects of the angular view system,

Metadata

selector foo

Index

Properties
Inputs
Accessors

Inputs

cnt

Type: number

Default value: 0

inc

Type: number

Properties

counter
counter:
Default value : 0

Accessors

inc
setinc(num: number)
Parameters :
Name Type Optional Description
num number
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++;
    }
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""