I want to redirect to another page depending on the option chosen, but it's not even console logging. I tried using ng-change too
HTML:
<select ng-options="option for option in selectCate" ng-
model="selectedCate" ng-click="selectedCateChange()">
</select>
JS:
$scope.selectCate = ['Amenities', 'Attractions'];
$scope.selectedCate = $scope.selectCate[0];
$scope.selectedCateChange = function () {
if ($scope.selectedCateChange == "Amenities")
{
console.log("aa")
}
else if ($scope.selectedCateChange == "Attractions")
{
$window.location.href = '#!/Attractions'
}
}
$state.go("your route name");instead of$window.location.hrefand make sure injecting$statein your controller. and change$scope.selectedCate = $scope.selectCate[0];to$scope.selectedCate = $scope.selectCate;