Update
1- IsShopToShowTerminated returns true which is expected but values doesn't reflects in the view.
I have shared angularjs code.
There IsShopToShowTerminated
is always undefined and doesn't depict the required value.
I think problem is because, it renders first and then value of the IsShopToShowTerminated
is changed.
After search I am getting more and more confused.
$scope.IsShopToShowTerminated = function(shopTerminationDate) {
setTimeout(function() {
debugger;
if ($scope.IsTerminated($scope.viewCompany.TerminationDate)) {
return true;
} else {
return $scope.IsTerminated(shopTerminationDate);
}
},
0);
}
<td ng-init="isTerminatedValue = IsShopToShowTerminated(shop.TerminatinonDate)">
{{isTerminatedValue}}
<div ng-show="isTerminatedValue">
<i class="fa fa-circle text-danger"></i>
<small>Terminated</small>
</div>
<div ng-show="isTerminatedValue">
<i class="fa fa-circle text-success"></i>
<small>Active</small>
</div>
</td>