Domanda

Is there any component that support LOV (list of value) in angularjs? My problem is like this, I have 2 combo box, the first has too much items, so i decided to provide suggestion to user with typeahead of bootstrap, after a user selects combo an item from combo 1, combo 2 will load some data that depends on combo 1.

essentially, I would like to create the famous state-city component with angular js.

Thanks

EDIT:

Ok, I find this components that are promising,

AngularUI Select2, Select2, Bootstrap Combobox

I think I can make it work, but right now I haven't time to try it out. Thanks every one.

È stato utile?

Soluzione

You can try usint lov-typeahead which is an angularjs directive that implements a list of values using twitter's typeahead: https://github.com/mihaigiurgeanu/lov-typeahead.

If you use bower, you can install it doing:

bower install lov-typeahead --save

Altri suggerimenti

You should read the docs and guide.

Simple use ng-model and $watch for its change. On changing, request states with $resource.

Read the docs. If you still can't figure how to implement it, post here again.

What about using a filter in the second combo based on the value on the first one?

http://docs.angularjs.org/tutorial/step_03

Maybe this directive will be helpfull too:

https://github.com/rolandocc/lov-angular-directive

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top