Corrections slides

This commit is contained in:
2015-04-09 20:36:17 +02:00
parent ccfe7374cc
commit e0ad7f004d
18 changed files with 319 additions and 86 deletions

View File

@ -1,19 +1,20 @@
# .cadoles-slide-title[Les directives de base (4/6)]
# .cadoles-slide-title[Les directives de base (4/5)]
**Conditions dans les templates: `ng-show`, `ng-hide`, `ng-switch`**
**Modification dynamique du style: `ng-class`**
```html
<html>
<body ng-app="myApp">
<div ng-controller="MainCtrl" ng-init="myTest = true; myVal = 'foo'">
<span ng-hide="myTest === true">Caché !</span>
<span ng-show="myTest === true">Affiché !</span>
<style>
.red { color: red; }
.blue { color: blue; }
.xxl { font-size: 50px; font-weight: bold; }
</style>
<div ng-controller="MainCtrl" ng-init="iLoveBlue=true; iLoveRed=false; myClasses=['red', 'xxl']">
<div ng-switch="myTest === true">
<span ng-switch-when="foo">Affiché !</span>
<span ng-switch-when="bar">Caché !</span>
<span ng-switch-default="baz">Caché !</span>
</div>
<span ng-class="myClasses">Rouge et large</span>
<span ng-class="{'red': iLoveRed, 'blue': iLoveBlue}">Bleu</span>
</div>
<script src="angular.js"></script>