| Index: third_party/pkg/angular/lib/directive/ng_show_hide.dart
|
| diff --git a/third_party/pkg/angular/lib/directive/ng_show_hide.dart b/third_party/pkg/angular/lib/directive/ng_show_hide.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..af9b4581e543b6b9e02c073919e1bda922a4ef01
|
| --- /dev/null
|
| +++ b/third_party/pkg/angular/lib/directive/ng_show_hide.dart
|
| @@ -0,0 +1,50 @@
|
| +part of angular.directive;
|
| +
|
| +/**
|
| + * The ngHide directive shows or hides the given HTML element based on the
|
| + * expression provided to the ngHide attribute. The element is shown or hidden
|
| + * by changing the removing or adding the ng-hide CSS class onto the element.
|
| + */
|
| +@NgDirective(
|
| + selector: '[ng-hide]',
|
| + map: const {'ng-hide': '=>hide'} )
|
| +class NgHideDirective {
|
| + static String NG_HIDE_CLASS = 'ng-hide';
|
| +
|
| + dom.Element element;
|
| +
|
| + NgHideDirective(this.element);
|
| +
|
| + set hide(value) {
|
| + if (toBool(value)) {
|
| + element.classes.add(NG_HIDE_CLASS);
|
| + } else {
|
| + element.classes.remove(NG_HIDE_CLASS);
|
| + }
|
| + }
|
| +}
|
| +
|
| +/**
|
| + * The ngShow directive shows or hides the given HTML element based on the
|
| + * expression provided to the ngHide attribute. The element is shown or hidden
|
| + * by changing the removing or adding the ng-hide CSS class onto the element.
|
| + */
|
| +@NgDirective(
|
| + selector: '[ng-show]',
|
| + map: const {'ng-show': '=>show'})
|
| +class NgShowDirective {
|
| + static String NG_SHOW_CLASS = 'ng-show';
|
| +
|
| + dom.Element element;
|
| +
|
| + NgShowDirective(this.element);
|
| +
|
| + set show(value) {
|
| + if (toBool(value)) {
|
| + element.classes.add(NG_SHOW_CLASS);
|
| + } else {
|
| + element.classes.remove(NG_SHOW_CLASS);
|
| + }
|
| + }
|
| +}
|
| +
|
|
|