I have a select that is dynamically populated on Angular:
<select material-select watch name="cat" id="cat"
ng-model="cat" ng-change="getSubcategoriesForThisCategory(cat)">
<option ng-repeat="category in allCategories" value="{{category.id}}">{{category.name}}</option>
</select>
And here in the controller is where that variable is filled:
$scope.allCategories = $scope.request.getCategories();
When the value of this select changes the following happens:
$scope.getSubcategoriesForThisCategory = function(cat){
$scope.allSubcategories = $scope.request.getSubcategoriesForSpecificCategory(cat);
}
Will putting the following suffice or do I need to do something else? :
<select material-select watch name="subcat" id="subcat"
ng-model="subcat" ng-change="getSubcategoryData(subcat)">
<option ng-repeat="subcategory in allSubcategories" value="{{subcategory.id}}">{{subcategory.name}}</option>
</select>
I have no way to prove whether this works or not since I have no access to the Laravel restful API nor the database, I just got a list of methods to call so I can get/create/update/delete (I know this is not optimal but it's what I got). Will the above "work"?