ng-cloak

What is ng-cloak:ng-cloak used to prevent for showing raw HTML or uncompiled HTML ..
Description of ng-cloak:ng-cloak has priority 0.
When browser displayed our HTML code , some time its takes time to load due to network or any other problem meanwhile this time browser displayed or raw(uncompiled ) HTML. ng-cloak prevent this (showing raw HTML ) with css and beautify this code. Although we can add ng-cloak in our most parent tag( tag) and it will work ,but we should use ng-cloak in every place where we need it. we have to put some css and use ng-cloak in our HTML code [ng\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],ng-cloak,x-ng-cloak{ display:none !important }.
Syntax of ng-cloak:
<style>
      [ng\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],ng-cloak,x-ng-cloak
      {
     display:none !important;
      }

  </style>
<element ng-cloak>
            {{expression}}
</element>
or


<div ng-cloak>
    {{expression}}
</div>
How to Use ng-cloak/ng-cloak Example::
 Example :
<style>
      [ng\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],ng-cloak,x-ng-cloak
      {
     display:none !important;
      }

  </style>
<div ng-app="webapp">
    <div  ng-init="expression='Hello'">
        <div ng-cloak>
            {{expression}}
        </div>
    </div>

</div>

No comments :

Post a comment