Declaring an input variable in angular

Code examples

0
0

@Component({
    selector: 'my-component',
    template: '<h3> My component </h3>'
})

export class MyComponent {
    @Input()
    set name(str: string) {
        this.service.setName(str);
        console.log(str);
    }
}

Similar pages

Similar pages with examples

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................