How to remove double braces notation while page is loading in AngularJS.
While developing AngularJs application we use curly braces notation for data binding.
When the page is loading, The AngularJS has not initialized that time those "Curly braces are visible in the UI with the our binding expression". So how to fix that?
We use ng-cloak built in directive to remove curly braces.
The
ngCloak directive is used to prevent the AngularJS html template from being briefly displayed by the browser in its raw (uncompiled) form while your application is loading. So we use this directive to hide those curly braces notation while application is loading.ngCloak directive uses
<div id="helloDiv" ng-cloak>{{ 'hello' }}</div>
ng-bind can also be used
Use ng-bind built in directive instead of curly braces notation.
<div id="helloDiv" ng-bind="hello"></div>
Any Question:
I hope this article helps you to resolve the issue regarding angularjs curly braces notation. If you have any question please write your comments in the comments section below.
Thank you.