0

I am using Angular Strap BS-Select and trying to update dropdown 2 data based on dropdown1. I am not sure on how to achieve this behavior . I tried the following code which didn't helped

<button type="button" ng-model="filters.selectedCategory" name="categoryFilter"
                data-html="1" ng-options="category.CategoryId as category.Name for category in filterList.CategoryFilter" placeholder="Select Category"  bs-select>
</button>
<button type="button" ng-model="filters.selectedSubCategory" name="subcategoryFilter"
                data-html="1" ng-options="category.CategoryId as category.Name for category in filterList.SubCategoryFilter | filter: {ParentCategoryId:filters.selectedCategory}"
                placeholder="Select Sub.Cat" bs-select>
</button>

In the above subcategoryFilter button if i use hardcoded filter, the list is filtering: {ParentCategoryId:11}".

So how do I populate the subcategoryFilter button dynamically whenever there is a change in Category dropdown. My assumption from the ng-repeat sample of Angular was that whenever the ng-model/Scope gets changed the list will be filterd. Looks like i misunderstood and missing something here

Fabian N.
  • 3,807
  • 2
  • 23
  • 46
sivakumar
  • 45
  • 1
  • 1
  • 9
  • 1
    possible duplicate of [angularjs cascading select/dropdowns](http://stackoverflow.com/questions/18723399/angularjs-cascading-select-dropdowns) – SoluableNonagon Sep 09 '14 at 20:15
  • 1
    https://stackoverflow.com/questions/19314810/angularjs-cascade-dropdown – SoluableNonagon Sep 09 '14 at 20:16
  • Thanks for point this. Yes, its the same. Got some idea, on what was the issue. I tried the select element as below and it worked. However bs-select didn't worked in this scenario. Looks like a bug in Bs-Select (Angular Strap), or some implementation changes required in Angular Strap select. – sivakumar Sep 09 '14 at 20:57

0 Answers0