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

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

Issue 180843004: Revert revision 33053 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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 @NgDirective(
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 NgHideDirective {
12 static String NG_HIDE_CLASS = 'ng-hide'; 12 static String NG_HIDE_CLASS = 'ng-hide';
13 13
14 final dom.Element element; 14 dom.Element element;
15 15
16 NgHideDirective(this.element); 16 NgHideDirective(this.element);
17 17
18 set hide(value) { 18 set hide(value) {
19 if (toBool(value)) { 19 if (toBool(value)) {
20 element.classes.add(NG_HIDE_CLASS); 20 element.classes.add(NG_HIDE_CLASS);
21 } else { 21 } else {
22 element.classes.remove(NG_HIDE_CLASS); 22 element.classes.remove(NG_HIDE_CLASS);
23 } 23 }
24 } 24 }
25 } 25 }
26 26
27 /** 27 /**
28 * The ngShow directive shows or hides the given HTML element based on the 28 * 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 29 * 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. 30 * by changing the removing or adding the ng-hide CSS class onto the element.
31 */ 31 */
32 @NgDirective( 32 @NgDirective(
33 selector: '[ng-show]', 33 selector: '[ng-show]',
34 map: const {'ng-show': '=>show'}) 34 map: const {'ng-show': '=>show'})
35 class NgShowDirective { 35 class NgShowDirective {
36 final dom.Element element; 36 static String NG_SHOW_CLASS = 'ng-show';
37
38 dom.Element element;
37 39
38 NgShowDirective(this.element); 40 NgShowDirective(this.element);
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 element.classes.add(NG_SHOW_CLASS);
43 } else { 45 } else {
44 element.classes.add(NgHideDirective.NG_HIDE_CLASS); 46 element.classes.remove(NG_SHOW_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