javascript - UI select based on other using angularjs filter -


i have used ui select angularjs project

country list

    [{         "_id": "596dbedd7892ca3f3e331aca",         "updatedat": "2017-07-18t07:55:09.318z",         "createdat": "2017-07-18t07:55:09.318z",         "countryname": "australia",         "countrycode": "abc",         "countrycurrencycode": "abc",         "countrycurrencysymbol": "*\r",         "slug": "australia",         "sortno": 2,         "createdby": "57eb8bf7216c5a624b19a504",         "modifiedby": "57eb8bf7216c5a624b19a504",         "version": "nil",         "__v": 0,         "isactive": true     }, {         "_id": "5972ed8dd470521889c468b9",         "updatedat": "2017-07-26t10:54:05.817z",         "createdat": "2017-07-22t06:15:41.356z",         "countryname": "india",         "countrycode": "ind",         "countrycurrencycode": "inr",         "countrycurrencysymbol": "¥",         "slug": "india",         "sortno": 4,         "createdby": "57eb8bf7216c5a624b19a504",         "modifiedby": "57eb8bf7216c5a624b19a504",         "version": "nil",         "__v": 0,         "isactive": true     }, {         "_id": "5972ed8dd470521889c468ba",         "updatedat": "2017-07-22t06:18:08.309z",         "createdat": "2017-07-22t06:15:41.365z",         "countryname": "unitede kingtom",         "countrycode": "xyz",         "countrycurrencycode": "xyz",         "countrycurrencysymbol": "#",         "slug": "unitede-kingtom",         "sortno": 5,         "createdby": "57eb8bf7216c5a624b19a504",         "modifiedby": "57eb8bf7216c5a624b19a504",         "version": "nil",         "__v": 0,         "isactive": true     }, {         "_id": "59786d52618a2b796c13593f",         "updatedat": "2017-07-26t10:22:10.957z",         "createdat": "2017-07-26t10:22:10.957z",         "countryname": "qwee",         "countrycode": "wewq",         "countrycurrencycode": "ing",         "countrycurrencysymbol": "€",         "slug": "qwee",         "sortno": 7,         "createdby": "57eb8bf7216c5a624b19a504",         "modifiedby": "57eb8bf7216c5a624b19a504",         "version": "nil",         "__v": 0,         "isactive": true     }, {         "_id": "597b0521e0d5ae36c3d4aadb",         "updatedat": "2017-07-28t09:42:39.755z",         "createdat": "2017-07-28t09:34:25.959z",         "countryname": "india",         "countrycode": "ind",         "countrycurrencycode": "aus",         "countrycurrencysymbol": "€",         "slug": "india-sj5xstoiz",         "sortno": 10,         "createdby": "57eb8bf7216c5a624b19a504",         "modifiedby": "57eb8bf7216c5a624b19a504",         "version": "nil",         "__v": 0,         "isactive": true     }] 

and in other ui select state list

[{         "_id": "596dcfbfe25f9d4738bea7d9",         "updatedat": "2017-07-18t09:07:11.835z",         "createdat": "2017-07-18t09:07:11.835z",         "countryid": "596dbedd7892ca3f3e331aca",         "statename": "south australia",         "timezone": "58c6516abf49c40fce836a1b",         "sortno": 0,         "createdby": "57eb8bf7216c5a624b19a504",         "version": "nil",         "__v": 0,         "isactive": true,         "slug": "south-australia"     }, {         "_id": "596dcfbfe25f9d4738bea7db",         "updatedat": "2017-07-18t09:07:11.846z",         "createdat": "2017-07-18t09:07:11.846z",         "countryid": "596dbedd7892ca3f3e331aca",         "statename": "western australia",         "timezone": "58c64e1abf49c40fce836a1a",         "sortno": 2,         "createdby": "57eb8bf7216c5a624b19a504",         "version": "nil",         "__v": 0,         "isactive": true,         "slug": "western-australia"     }, {         "_id": "596dd0ede25f9d4738bea7dd",         "updatedat": "2017-07-18t09:12:13.161z",         "createdat": "2017-07-18t09:12:13.161z",         "countryid": "596dbedd7892ca3f3e331aca",         "statename": "new south wales",         "timezone": "58c64e1abf49c40fce836a1a",         "sortno": 4,         "createdby": "57eb8bf7216c5a624b19a504",         "version": "nil",         "__v": 0,         "isactive": true,         "slug": "new-south-wales"     }, {         "_id": "59786e36618a2b796c135941",         "updatedat": "2017-07-26t10:25:58.705z",         "createdat": "2017-07-26t10:25:58.705z",         "countryid": "59786d8d618a2b796c135940",         "statename": "tets@123",         "timezone": "58c64e1abf49c40fce836a1a",         "sortno": 5,         "createdby": "57eb8bf7216c5a624b19a504",         "version": "nil",         "__v": 0,         "isactive": true,         "slug": "tets123"     }] 

here, have 2 ui select. 1 country , other 1 state list. when user clicks on country list, state list have filtered based on _id using angualrjs filter.

we can normal select using filter but, in ui select how that?


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -