D
D
des1roer2016-06-12 11:39:58
Angular
des1roer, 2016-06-12 11:39:58

Angular autocomplete and linked list?

There is such task - there are three lists. You can enter in any and then the values ​​​​should be pulled into the rest according to the entered.
Those. car - model - year.
When choosing 2x, the third one is filled in automatically. How to approach this task?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Tsepkovsky, 2016-06-17
@Zippovich

It's not entirely clear what the question is. Write a watcher that will send these values ​​to the server when any value from 3 fields changes, a set of valid values ​​is returned from the server
[{vehicle: 'vvv1', model: 'mmm1', year: 2015}, {...}, { ...}]
after the filter, it is clear that you can set some value if it is unique.
Or, if it is possible to store these 3 lists initially in js (for example, it comes from the server when changing the route), then it will not be necessary to send requests to the server.
Because the link watcher -> request is dumb.
Here you can use dropdowns or typeahead - which is more convenient

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question