Component Angular Autocomplete

Asked

Viewed 148 times

2

I am using in my project the components of the Primeng library. Would someone like to tell me if in the Autocomplete component (of this library in question) it is possible to set a default value for it?

1 answer

1


Gustavo, you can add default value using the ngModel directive, where you will assign a variable to receive the value of the Component, this variable can be started with the default value in your Komponent ngInit for example, a look at the documentation of Angular and also of Primeng where already possessed an example using ngModel or formControl.

https://angular.io/api/forms/NgModel

https://www.primefaces.org/primeng/#/autocomplete

  • It worked here now. I was doing it, but for some reason it wasn’t working. So I thought there was some other way. But ball show, it was worth the force.

Browser other questions tagged

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