Answer the question
In order to leave comments, you need to log in
Creating an Angular7 component?
There is a component that takes a type parameter from the parent:
in the parent component <app-input type="text"></app-input>
inside app-input:
- js - @Input() type;
- html -
Is it possible to make it so that in the parent component, when filling in the type attribute, it would offer type selection options: text, password, someoneelse? Thanks in advance! <input [type]="type" />
Answer the question
In order to leave comments, you need to log in
Thank you all for your attention. Found the answer!
Inside app-input we write: @Input() type: 'text' | 'password' = 'text';
And then in the parent component in
<app-input type="редактор кода сам будет предлагать text или password"></app-input>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question