toolbar-header.js 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { Directive, ElementRef, Optional, Renderer } from '@angular/core';
  2. import { Config } from '../../config/config';
  3. import { Ion } from '../ion';
  4. import { ViewController } from '../../navigation/view-controller';
  5. /**
  6. * @name Header
  7. * @description
  8. * Header is a parent component that holds the navbar and toolbar component.
  9. * It's important to note that `ion-header` needs to be one of the three root elements of a page
  10. *
  11. * @usage
  12. *
  13. * ```html
  14. * <ion-header>
  15. * <ion-navbar>
  16. * <ion-title>Page1</ion-title>
  17. * </ion-navbar>
  18. *
  19. * <ion-toolbar>
  20. * <ion-title>Subheader</ion-title>
  21. * </ion-toolbar>
  22. * </ion-header>
  23. *
  24. * <ion-content></ion-content>
  25. * ```
  26. *
  27. */
  28. export class Header extends Ion {
  29. constructor(config, elementRef, renderer, viewCtrl) {
  30. super(config, elementRef, renderer, 'header');
  31. viewCtrl && viewCtrl._setHeader(this);
  32. }
  33. }
  34. Header.decorators = [
  35. { type: Directive, args: [{
  36. selector: 'ion-header'
  37. },] },
  38. ];
  39. /** @nocollapse */
  40. Header.ctorParameters = () => [
  41. { type: Config, },
  42. { type: ElementRef, },
  43. { type: Renderer, },
  44. { type: ViewController, decorators: [{ type: Optional },] },
  45. ];
  46. //# sourceMappingURL=toolbar-header.js.map