javascript - How to use angularjs to change the values of another select tag? -


i have 2 web api's calling. each value in first api type has id needs used filter second api category. json below:

// types [{"id":1,"text":"hardware","description":"hardware"},   {"id":2,"text":"software,"description":"software"}"}];  // categories [{"id":1,"typeid":1,"parentid":0,"name":"printing"},   {"id":2,"typeid":1,"parentid":1,"name":"toner"}] 

first of all, have store selectedtypeid used filter array, , can call angular $filter in second array.

sintax:

$filter('filter')(array, expression, comparator) 

e.g:

$filter('filter')($scope.categories, {typeid: $scope.selectedtypeid}, comparator) 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -