Angularjs How to open a page-hide display expression tutorial

Source: Internet
Author: User
Tags comments

This example describes the use of Angularjs open page hide display expressions. Share to everyone for your reference, specific as follows:

1. Use Ng-cloak while adding a line to CSS [Ng-cloak] {display:none} style [Ng:cloak], [Ng-cloak], [Data-ng-cloak], [X-ng-cloak],. Ng-cloa K,. x-ng-cloak {display:none!important;}

2. Using Ng-bind, instead of {{}}, is inconvenient, because a DOM node binding must be used after using Ng-bind, for example, without the need for DOM nodes on span, not directly {{}}

3. Use of Ng-model

<% include common/header.html%>

<style>[ng-cloak] {display:none!important;} </style>

<!--S main-->

<div class= "main g_cf" ng-app= "myApp" >

<div class= "CONTAIN_LF" >

<H2 class= "About_tit" >ABOUT

<div class= "ab_content" ng-controller= "AboutUs" ng-show= "true" >

<div class= "hr" ng-bind= "Clumndata.title" ng-cloak></div>

<p ng-bind= "Clumndata.detail" ></p>

<p ng-cloak>{{clumndata.email.title}}:<a href= "Mailto:{{clumndata.email.link}}" target= "_blank" ClumnData.email.link "ng-cloak>768065158@qq.com</a></p>

<p ng-repeat = "item in clumndata.list" Ng-cloak >{{item.title}}:<a href= "{{item.link}}" target= "_blank" Ng-bind= "Item.link" ng-cloak></a></p>

</div>

<div class= "ab_content" ng-controller= "comment" >

<div class= "hr" ng-bind= "title" Ng-cloak></div>

<div class= "Comment_user" >

<input type= "text" name= "username" placeholder= "Your Name" >

</div>

<div class= "Comment_con" >

<textarea id= "Editarea" maxlength= "placeholder=" Please input comments, less than 300 characters "></textarea>

<div class= "COMMENT_BTN" >

<span>ctrl + Enter Send comments, words: 0/300</span><input type= "Submit" class= "COMMIT_BTN" value= "confirm" Ng-click = " Comment () ">

</div>

</div>

</div>

<input type= "text" ng-model= "name" >{{name}}

</div>

<div class= "Contain_rg" >

<div class= "Rg_tp_clum1" >

<p> there is more knowledge to share and communicate. </p>

<p><%= content%></p>

<p><%= Date%></p>

</div>

</div>

</div>

<div id= "Next" >111111</div>

<!--E main-->

<% include common/jsfoot.html%>

<script>

Angular.element (document.getElementById ("Next")). Bind (' click ', function () {

alert (this.innerhtml);

});

Varapp = Angular.module ("myApp", [],function () {console.log (' strat ')});

Varclumndata = {

Title: "About Me",

Detail: "Small front-end one, like JavaScript, like Nodejs, like Canvas",

Email:{title: "Mailbox", Link: "768065158@qq.com"},

List:[{title: "GitHub", Link: "https://github.com/pingfanren/"},

{title: "Cloud-Habitat Community Network", Link: "http://www.111cn.net/"},

{title: "Technology sharing platform", Link: "http://pingfan1990.sinaapp.com/"},

{title: "Front-end navigation platform", Link: "http://doc.pfan123.com/"},

]

};

App.controller ("AboutUs", function ($scope) {

$scope. clumndata = Clumndata;

});

App.controller ("comment", function ($scope) {

$scope. title = "Give Me a Message";

$scope. Comment=function () {

}

});

</script>

<% include common/footer.html%>

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.