import {Component, Directive, Host, ElementRef, Renderer, Optional, forwardRef, Inject} from 'angular2/angular2';
import {Ion} from '../ion';
import {Config} from '../../config/config';
import {MenuToggle} from '../menu/menu-toggle';
import {Navbar} from '../navbar/navbar';
/**
* TODO
*/
export class ToolbarBase extends Ion {
constructor(
elementRef: ElementRef,
config: Config
) {
super(elementRef, config);
this.itemRefs = [];
this.titleRef = null;
}
setTitleCmp(titleCmp) {
this.titleCmp = titleCmp;
}
getTitleText() {
return (this.titleCmp && this.titleCmp.getTitleText()) || '';
}
/**
* TODO
* @returns {TODO} TODO
*/
getTitleRef() {
return this.titleCmp && this.titleCmp.elementRef;
}
/**
* A toolbar items include the left and right side `ion-nav-items`,
* and every `menu-toggle`. It does not include the `ion-title`.
* @returns {TODO} Array of this toolbar's item ElementRefs.
*/
getItemRefs() {
return this.itemRefs;
}
addItemRef(itemElementRef) {
this.itemRefs.push(itemElementRef);
}
}
/**
* TODO
*/
@Component({
selector: 'ion-toolbar',
template:
'