import { ContentChildren , Directive , ElementRef , Inject , Optional , Renderer , forwardRef } from '@angular/core' ; import { Button } from '../button/button' ; import { Config } from '../../config/config' ; import { Ion } from '../ion' ; import { Navbar } from './navbar' ; import { Toolbar } from './toolbar' ; hidden @ Directive ( { selector : 'ion-buttons,[menuToggle]' } ) export class ToolbarItem extends Ion { inToolbar : boolean ; constructor ( config , elementRef , renderer , @ Optional ( ) toolbar , @ Optional ( ) @ Inject ( forwardRef ( ( ) => Navbar ) ) navbar ) { super ( config , elementRef , renderer , 'bar-buttons' ) ; this . inToolbar = ! ! ( toolbar || navbar ) ; } @ ContentChildren ( Button ) set _buttons ( buttons ) { if ( this . inToolbar ) { buttons . forEach ( ( button ) => { button . setRole ( 'bar-button' ) ; } ) ; } } }