English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

AngularJS ng-Commande show

AngularJS 参考手册

Affichage HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://cdn.staticfile.org/angular.js/1.4.6/angular.min.js"></script>
</head>
<body ng-app="">
Afficher HTML: <input type="checkbox" ng-model="myVar">
<div ng-show="myVar">
<h1>Welcome</h1>
<p>Welcome to my home.</p>
</div>
</body>
</html>
Voyons voir ‹/›

Définition et utilisation

ng-show L'instruction affiche l'élément HTML spécifié lorsque l'expression est vraie, sinon elle cache l'élément HTML spécifié.

Syntaxe

   <element ng-show="expression"></element>

Tous les éléments HTML supportent cette instruction.

Valeur du paramètre

ValeurDescription
expressionSi l'expression est vraie, affiche l'élément HTML spécifié.

AngularJS 参考手册