ANGULARJS Basic Ng-cloak Instruction Simple example _angularjs

Source: Internet
Author: User


Angularjs ng-cloak Instruction



Angularjs instance



Prevent application flicker when page loads:


<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script>
</head>
<body>
<div ng-app="">
<p ng-cloak>{{ 5 + 5 }}</p>
<p><b>Note: < / b > this example only demonstrates the application of instructions. </p>
</div>
</body>
</html> 


Run Result:



10



Note: This example simply demonstrates the application of the directive.



Definitions and usage



The ng-cloak directive is used to prevent problems that occur when the ANGULARJS application prevents Angularjs code from loading at load time.



ANGULARJS Application when loading, the document may appear Angularjs code because the ANGULARJS code is not loaded, which will have a blinking effect, ng-



The cloak directive is designed to prevent this problem from occurring.



Grammar



<element ng-cloak></element>



All HTML elements are supported.



Parameter values



The NG-CLOAK directive has no parameters.



The above is the ng-cloak instruction data collation, follow-up continue to supplement, there is a need for the reference of friends.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.