import { ChangeDetectionStrategy , Component , ElementRef , Inject , Optional , Renderer , ViewEncapsulation , forwardRef , } from '@angular/core' ; import { Config } from '../../config/config' ; import { Ion } from '../ion' ; import { Navbar } from './navbar' ; import { Toolbar } from './toolbar' ; name description usage demo @ Component ( { selector : 'ion-title' , template : '<div class="toolbar-title" [ngClass]="\'toolbar-title-\' + _mode">' + '<ng-content></ng-content>' + '</div>' , changeDetection : ChangeDetectionStrategy . OnPush , encapsulation : ViewEncapsulation . None , } ) export class ToolbarTitle extends Ion { constructor ( config , elementRef , renderer , @ Optional ( ) toolbar , @ Optional ( ) @ Inject ( forwardRef ( ( ) => Navbar ) ) navbar ) { super ( config , elementRef , renderer , 'title' ) ; toolbar && toolbar . _setTitle ( this ) ; navbar && navbar . _setTitle ( this ) ; } hidden getTitleText ( ) { return this . _elementRef . nativeElement . textContent ; } }