0
I’m trying to implement a Multiselect Dynamic dropdown on Angular, it’s like it’s selecting state according to cities, if I select for example PE in the first dropdown list to it will return me automatically in the dropdown list the list of all the cities of Pernambuco if I happen to select SP in the first dropdown list then it will return me in the second dropdown list the list of all city of São Paulo and so on.
As I have little experience and do not know how to implement this, I am trying to make this implementation into pieces.
See the code below:
listarTodas(): Promise<any> {
return this.http.get(this.cidadesUrl)
.toPromise()
.then(response => console.log(response.json()));
}
This is the return in json:
- I’d like to return at console browser only the attributes of code
- I would also like to return at console browser only code code 1
For me it is important to know these things because when I start to understand these principles of implementation I will be able to start implementing dropdown Multiselect
You want to print on the console only the records that have
codigoEstado === 1
? In the example given, it would be{codigo: 1, nome: "Rio Branco", codigoEstado: 1}, {codigo: 2, nome: "Cruzeiro do Sul", codigoEstado: 1}
– mercador
first I want to thank you for helping me, but this is exactly what I need!
– wladyband