On my webpage, I have content that is enclosed in an ng-if directive as shown below:
<div ng-if="ShowMessgae" class="text-danger">
<p>
<strong>
Message displayed to User
</strong>
</p>
</div>
Within my AngularJS controller, I have the following setup:
function MyController($scope, $q, notifyHelper) {
openAjaxLoaderGif();
$scope.ShowMessgae = false;
MyService.getVarsFromSession().then(function (result) {
// code omitted for brevity
if(some coditional) {
$scope.ShowMessgae = true;
}
}, function (data, failReason, headers) {
notifyHelper.error("Error has occurred - try again");
})
})
.finally(function () {
closeAjaxLoaderGif();
});
};
I am initializing the ShowMessage variable to false and it only becomes true under certain conditions.Usually, ShowMessage will be false. However, when the page loads, the "Message displayed to User" text briefly appears and then disappears. Is there something wrong causing this flicker effect?