I have an issue where I have to display one of two ui-grids depending on a selection by the user. The problem is using the 'if' statement causes Angular to run several digest cycles. This is not a problem in Chrome, but in IE 11, it crashes the browser. Is there anyway to tell Angular to run the digest cycle once? Or is there a better way to implement the switch in grids? This is a real problem as most of our users use IE.
Here is the code that is causing the problem:
if ($scope.form.ReleasedStatus == 3) {
$scope.generalSearch = false;
}
$scope.waitsearch = generalsearchService.submitSearch($scope.form)
.success(function (data) {
$scope.results = data;
$scopee.gridOptions.data = data;
$scope.gridOptions3.data = data;
});
and here is my HTML:
<div ng-show="generalSearch">
<div ui-grid="gridOptions" class="grid" ui-grid-pagination ui-grid-exporter ui-grid-auto-resize></div>
</div>
<div ng-hide="generalSearch">
<div ui-grid="gridOptions3" class="grid" ui-grid-pagination ui-grid-exporter ui-grid-auto-resize></div>
</div>
If "generalSearch" is "true" it is supposed to show the first grid. If it is false, it is supposed to show the second. It runs about 3 digest cycles (from what I can tell) to keep checking which of the grids to display.
Any assistance is greatly appreciated!