1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. var __extends = (this && this.__extends) || (function () {
  2. var extendStatics = Object.setPrototypeOf ||
  3. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  4. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  5. return function (d, b) {
  6. extendStatics(d, b);
  7. function __() { this.constructor = d; }
  8. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  9. };
  10. })();
  11. (function (factory) {
  12. if (typeof module === "object" && typeof module.exports === "object") {
  13. var v = factory(require, exports);
  14. if (v !== undefined) module.exports = v;
  15. }
  16. else if (typeof define === "function" && define.amd) {
  17. define(["require", "exports", "@angular/core", "../../platform/platform", "./display-when"], factory);
  18. }
  19. })(function (require, exports) {
  20. "use strict";
  21. Object.defineProperty(exports, "__esModule", { value: true });
  22. var core_1 = require("@angular/core");
  23. var platform_1 = require("../../platform/platform");
  24. var display_when_1 = require("./display-when");
  25. /**
  26. * @name HideWhen
  27. * @description
  28. * The `hideWhen` attribute takes a string that represents a plaform or screen orientation.
  29. * The element the attribute is added to will only be hidden when that platform or screen orientation is active.
  30. *
  31. * Complements the [showWhen attribute](../ShowWhen). If the `hideWhen` attribute is used on an
  32. * element that also has the `showWhen` attribute, the element will not show if `hideWhen` evaluates
  33. * to `true` or `showWhen` evaluates to `false`. If the `hidden` attribute is also added, the element
  34. * will not show if `hidden` evaluates to `true`.
  35. *
  36. * View the [Platform API docs](../../../platform/Platform) for more information on the different
  37. * platforms you can use.
  38. *
  39. * @usage
  40. * ```html
  41. * <div hideWhen="android">
  42. * I am hidden on Android!
  43. * </div>
  44. *
  45. * <div hideWhen="ios">
  46. * I am hidden on iOS!
  47. * </div>
  48. *
  49. * <div hideWhen="android,ios">
  50. * I am hidden on Android and iOS!
  51. * </div>
  52. *
  53. * <div hideWhen="portrait">
  54. * I am hidden on Portrait!
  55. * </div>
  56. *
  57. * <div hideWhen="landscape">
  58. * I am hidden on Landscape!
  59. * </div>
  60. * ```
  61. *
  62. * @demo /docs/demos/src/hide-when/
  63. * @see {@link ../ShowWhen ShowWhen API Docs}
  64. * @see {@link ../../../platform/Platform Platform API Docs}
  65. */
  66. var HideWhen = (function (_super) {
  67. __extends(HideWhen, _super);
  68. function HideWhen(hideWhen, plt, zone) {
  69. return _super.call(this, hideWhen, plt, zone) || this;
  70. }
  71. HideWhen.decorators = [
  72. { type: core_1.Directive, args: [{
  73. selector: '[hideWhen]',
  74. host: {
  75. '[class.hidden-hide-when]': 'isMatch'
  76. }
  77. },] },
  78. ];
  79. /** @nocollapse */
  80. HideWhen.ctorParameters = function () { return [
  81. { type: undefined, decorators: [{ type: core_1.Attribute, args: ['hideWhen',] },] },
  82. { type: platform_1.Platform, },
  83. { type: core_1.NgZone, },
  84. ]; };
  85. return HideWhen;
  86. }(display_when_1.DisplayWhen));
  87. exports.HideWhen = HideWhen;
  88. });
  89. //# sourceMappingURL=hide-when.js.map