web:javascript:angularjs:directives_built-in
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
web:javascript:angularjs:directives_built-in [2014/12/04 03:40] – sgariepy | web:javascript:angularjs:directives_built-in [2022/02/02 00:42] (Version actuelle) – modification externe 127.0.0.1 | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | ====== Directives de base ====== | ||
+ | |||
+ | |||
+ | * ngApp | ||
+ | * ngController | ||
+ | |||
+ | |||
+ | ===== ng-model ===== | ||
+ | |||
+ | Fonctionne sur trois types d' | ||
+ | * input | ||
+ | * select | ||
+ | * textarea | ||
+ | |||
+ | |||
+ | |||
+ | |||
====== Événementiels ====== | ====== Événementiels ====== | ||
Ligne 15: | Ligne 32: | ||
+ | |||
+ | ====== Présentation ====== | ||
+ | |||
+ | ===== ngStyle ===== | ||
+ | |||
+ | |||
+ | ===== ngClass ===== | ||
+ | |||
+ | |||
+ | ===== ngClassEven ===== | ||
+ | |||
+ | |||
+ | ===== ngClassOdd ===== | ||
====== Divers ====== | ====== Divers ====== | ||
+ | |||
+ | |||
+ | ===== ng-bind ===== | ||
+ | |||
+ | Remplace l' | ||
+ | |||
+ | <code html> | ||
+ | <div ng-bind=" | ||
+ | </ | ||
+ | |||
+ | Le code ci-haut a le même effet que : | ||
+ | <code html> | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | ===== ng-bind-template ===== | ||
+ | |||
+ | Un peu comme '' | ||
+ | |||
+ | <code html> | ||
+ | <div ng-bind-template=" | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== ngBindHtml ===== | ||
+ | |||
+ | Permet d' | ||
+ | |||
+ | Si on a dans le contrôleur : | ||
+ | <code javascript> | ||
+ | $scope.snippet = '< | ||
+ | </ | ||
+ | |||
+ | Et dans le HTML ceci: | ||
+ | <code html> | ||
+ | <div ng-bind-html=" | ||
+ | </ | ||
+ | |||
+ | Le ''< | ||
+ | |||
+ | ===== ngBindHtmlUnsafe ===== | ||
+ | |||
+ | |||
+ | Même principe que **ngBindHtml**, | ||
+ | |||
+ | Attention, peut donner lieu à des attaques XSS. | ||
+ | |||
+ | |||
+ | |||
+ | ===== ng-show / ng-hide ===== | ||
Ligne 24: | Ligne 105: | ||
+ | ===== ngCloak ===== | ||
+ | |||
+ | |||
+ | Règle CSS: | ||
+ | |||
+ | <code css> | ||
+ | [ng\: | ||
+ | display: none; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== Autres ===== | ||
+ | * ngDisabled | ||
+ | * ngChecked | ||
+ | * ngMultiple | ||
+ | * ngReadonly | ||
+ | * ngSelected | ||
+ | |||
+ | |||
+ | |||
+ | ===== ngForm ===== | ||
+ | |||
+ | Permet d' | ||
+ | ===== ngSubmit ===== | ||
+ | |||
+ | |||
+ | |||
+ | ===== ngHref ===== | ||
+ | |||
+ | |||
+ | ===== ngSrc ===== | ||
+ | ===== ngNonBindable ===== | ||
web/javascript/angularjs/directives_built-in.1417660833.txt.gz · Dernière modification : 2022/02/02 00:43 (modification externe)