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

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

Issue 124053002: Adding Angular and dependent packages for testing (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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
(Empty)
1 part of angular.directive;
2
3 /**
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
6 * by changing the removing or adding the ng-hide CSS class onto the element.
7 */
8 @NgDirective(
9 selector: '[ng-hide]',
10 map: const {'ng-hide': '=>hide'} )
11 class NgHideDirective {
12 static String NG_HIDE_CLASS = 'ng-hide';
13
14 dom.Element element;
15
16 NgHideDirective(this.element);
17
18 set hide(value) {
19 if (toBool(value)) {
20 element.classes.add(NG_HIDE_CLASS);
21 } else {
22 element.classes.remove(NG_HIDE_CLASS);
23 }
24 }
25 }
26
27 /**
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
30 * by changing the removing or adding the ng-hide CSS class onto the element.
31 */
32 @NgDirective(
33 selector: '[ng-show]',
34 map: const {'ng-show': '=>show'})
35 class NgShowDirective {
36 static String NG_SHOW_CLASS = 'ng-show';
37
38 dom.Element element;
39
40 NgShowDirective(this.element);
41
42 set show(value) {
43 if (toBool(value)) {
44 element.classes.add(NG_SHOW_CLASS);
45 } else {
46 element.classes.remove(NG_SHOW_CLASS);
47 }
48 }
49 }
50
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698