T
T
tyoma_koder2021-10-30 17:50:00
Angular
tyoma_koder, 2021-10-30 17:50:00

How to pass data from a component?

There is an input component

<div class="input-text" >
  <p class="input-text__placeholder">{{placeholder}}</p>
  <input class="input-text__input" type="text">
</div>


How to use ngModel when using this component in another component? For each input, make a separate variable in @Output()?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Kadyrov, 2021-11-01
@Ahmad66617

It can be simpler - through the Output decorator - but not for each field a separate Output, but for example, pass an object to it through an EventEmitter with a list of fields - and read the properties at the output

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question