1

I am initialising a scope variable to false in controller

$scope.created=false;

However when the page loads for the fist time still the below message flickers once and then hides. Is there a way to stop this flicker and hide it fully when the page loads for the first time.

<div class="alert alert-success" ng-show="created">A new Entity created successfully.</div>

2 Answers 2

6

add ng-cloak to your div, it hides it until the controller is loaded.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks it works fine when loading the page for first time.. But when I click refresh it does not work properly and shows this banner. Any other way to fix this ?
1

Jay,

You can try this:

<div ng-init="created=false">
    <div class="alert alert-success" ng-show="created">A new Entity created successfully.</div>
</div>

And finally you can create a function that makes the variable created be true.

Look an example: Plunker

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.