Input value property does not work with Angular

Asked

Viewed 121 times

0

I’m having some problems with the property value of a text field:

<div class="container">
  <form class="row">

    <div class="col s4 input-field">

      <input
        id="campo"
        type="text"
        value="exemplo de texto"/>
      <label for="campo">campo</label>

    </div>

    <!-- demais campos -->

  </form>
</div>

When using the property on the component, Angular simply ignores it, and the field is empty, even if numbers or text are used. How can I fix this?

  • 2

    If I understand correctly, without doing Property Binding - [] couldn’t see it working anyway.

  • and it’s not like that?

1 answer

0

Imports the module FormsModule and uses [(ngModel)] in place of value.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.