input set variable angular

Solutions on MaxInterview for input set variable angular by the best coders in the world

showing results for - "input set variable angular"
Lotta
04 Jun 2020
1@Component({
2    selector: 'my-component',
3    template: '<h3> My component </h3>'
4})
5
6export class MyComponent {
7    @Input()
8    set name(str: string) {
9        this.service.setName(str);
10        console.log(str);
11    }
12}
13