Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: third_party/pkg/angular/lib/directive/ng_show_hide.dart

Issue 257423008: Update all Angular libs (run update_all.sh). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 part of angular.directive; 1 part of angular.directive;
2 2
3 /** 3 /**
4 * The ngHide directive shows or hides the given HTML element based on the 4 * The ngHide directive shows or hides the given HTML element based on the
5 * expression provided to the ngHide attribute. The element is shown or hidden 5 * expression provided to the ngHide attribute. The element is shown or hidden
6 * by changing the removing or adding the ng-hide CSS class onto the element. 6 * by changing the removing or adding the ng-hide CSS class onto the element.
7 */ 7 */
8 @NgDirective( 8 @Decorator(
9 selector: '[ng-hide]', 9 selector: '[ng-hide]',
10 map: const {'ng-hide': '=>hide'}) 10 map: const {'ng-hide': '=>hide'})
11 class NgHideDirective { 11 class NgHide {
12 static String NG_HIDE_CLASS = 'ng-hide'; 12 static String NG_HIDE_CLASS = 'ng-hide';
13 13
14 final dom.Element element; 14 final dom.Element element;
15 final Animate animate;
15 16
16 NgHideDirective(this.element); 17 NgHide(this.element, this.animate);
17 18
18 set hide(value) { 19 set hide(value) {
19 if (toBool(value)) { 20 if (toBool(value)) {
20 element.classes.add(NG_HIDE_CLASS); 21 animate.addClass(element, NG_HIDE_CLASS);
21 } else { 22 } else {
22 element.classes.remove(NG_HIDE_CLASS); 23 animate.removeClass(element, NG_HIDE_CLASS);
23 } 24 }
24 } 25 }
25 } 26 }
26 27
27 /** 28 /**
28 * The ngShow directive shows or hides the given HTML element based on the 29 * The ngShow directive shows or hides the given HTML element based on the
29 * expression provided to the ngHide attribute. The element is shown or hidden 30 * expression provided to the ngHide attribute. The element is shown or hidden
30 * by changing the removing or adding the ng-hide CSS class onto the element. 31 * by changing the removing or adding the ng-hide CSS class onto the element.
31 */ 32 */
32 @NgDirective( 33 @Decorator(
33 selector: '[ng-show]', 34 selector: '[ng-show]',
34 map: const {'ng-show': '=>show'}) 35 map: const {'ng-show': '=>show'})
35 class NgShowDirective { 36 class NgShow {
36 final dom.Element element; 37 final dom.Element element;
38 final Animate animate;
37 39
38 NgShowDirective(this.element); 40 NgShow(this.element, this.animate);
39 41
40 set show(value) { 42 set show(value) {
41 if (toBool(value)) { 43 if (toBool(value)) {
42 element.classes.remove(NgHideDirective.NG_HIDE_CLASS); 44 animate.removeClass(element, NgHide.NG_HIDE_CLASS);
43 } else { 45 } else {
44 element.classes.add(NgHideDirective.NG_HIDE_CLASS); 46 animate.addClass(element, NgHide.NG_HIDE_CLASS);
45 } 47 }
46 } 48 }
47 } 49 }
48 50
OLDNEW
« no previous file with comments | « third_party/pkg/angular/lib/directive/ng_repeat.dart ('k') | third_party/pkg/angular/lib/directive/ng_src_boolean.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698