angularjs - How to filter a select box based on a typeahead selection -
angularjs - How to filter a select box based on a typeahead selection -
when create new job select client , client employees based on property "customeremployeerole". select client typeahead input. need selection filter 2 select boxes client employees have same customerid selected customer. have created plunkr. plunker
<label>customer:</label> <input type="text" ng-model="currentitem.customername" typeahead="customer.customername client in customerarray | filter:$viewvalue" typeahead-on-select="selectcustomer($item)"> <label>customerpm:</label> <select ng-options="customer.customeremployeefirstname + ' ' + customer.customeremployeelastname customer.customeremployeefirstname + ' ' + customer.customeremployeelastname client in customeremployeearray | filter: {customeremployeerole : 'pm'}" ng-model="currentitem.customeremployeeid"> <option value="" selected="selected">select</option> </select> <label>customersuper:</label> <select ng-options="customer.customeremployeefirstname + ' ' + customer.customeremployeelastname customer.customeremployeefirstname + ' ' + customer.customeremployeelastname client in customeremployeearray | filter:{customeremployeerole : 'super'} " ng-model="currentitem.customeremployeeid"> <option value="" selected="selected">select</option> </select>
i think need this:
<select ng-options="customer.customeremployeefirstname + ' ' + customer.customeremployeelastname customer.customeremployeefirstname + ' ' + customer.customeremployeelastname client in customeremployeearray | filter:{customeremployeerole : 'super', customerid : currentitem.customerid} " ng-model="currentitem.customeremployeeid">
i mean need next filter:
filter:{customeremployeerole : 'super', customerid : currentitem.customerid}
so see customer employees
have role super
, id
on selected typeahead
currentitem.customerid
.
p.s. think have wrong models customerpm
, customersuper
: same,so when take pm - super has same value , in selectbox becomes select
. take different models these 2 select
's , working fine.
angularjs
Comments
Post a Comment