Consider selected array have two values $scope.selected = ["Show Activated","Show InActivated"]
This below source code is working fine because here i am checking the value manually for example: i am checking whether "Show Activated"* or " Show InActivated" then i am assign isActive value true or false
My requirement is dynamically i have to do this. if it is "Show Activated" assign isActive value is True. Please check this plunker link... http://ift.tt/1ItLgkf
This below source code in plunker won't work because it's my real code for understanding purpose added in that link. But selection part working fine.
// Object Filteration
$scope.objectFilterSubmit = function () {
if($scope.selected.length>1) {
$scope.IsActive = "";
$scope.selectedObjectDatas = $scope.getCustomObjectsBasedOnObjectTypeSelection($scope.IsActive);
clearPartialElement();
$scope.objectCreationPage();
} else {
angular.forEach($scope.selected, function(value,key){
if(angular.equals(value, "Show Activated")) {
$scope.IsActive = "true";
$scope.selectedObjectDatas = $scope.getCustomObjectsBasedOnObjectTypeSelection($scope.IsActive);
clearPartialElement();
$scope.objectCreationPage();
}
else if(angular.equals(value, "Show InActivated")) {
$scope.IsActive = "false";
$scope.selectedObjectDatas = $scope.getCustomObjectsBasedOnObjectTypeSelection($scope.IsActive);
clearPartialElement();
$scope.objectCreationPage();
}
else {
$scope.IsActive = "";
$scope.selectedObjectDatas = $scope.getCustomObjectsBasedOnObjectTypeSelection($scope.IsActive);
clearPartialElement();
$scope.objectCreationPage();
}
});
}
};
Please anyone help me to achieve this.
Aucun commentaire:
Enregistrer un commentaire