As of beta.6:
If you don’t want the nativeElement
but rather like to have the Ionic/Stencil object/component, do as you displayed
@ViewChild(Toolbar) toolbar: Toolbar;
if you do want the ElementRef
respectively the nativeElement
do as following (the read
attribute is the key)
<ion-toolbar #myToolbar></ion-toolbar>
@ViewChild('myToolbar', {read: ElementRef}) toolbar: ElementRef;