Search code examples
angularjstypescriptionic-frameworkmobiscroll

Can't get mobiscroll instance from Angular + Ionic


I can't seem to get the instance of my mobiscroll widget using Angular 4 with Ionic Framework. It seems that I'm doing everything correct but it won't select the actual widget.

Widget HTML:

<mbsc-widget [options]="emailLoginSettings" #emailLoginWidget="mobiscroll">
    <div class="md-logo micons icon-mbsc-logo"></div>
    <mbsc-form class="md-form">
        <div class="mbsc-form-group-inset">
        <mbsc-input type="email" name="Email" placeholder="Email" [(ngModel)]="loginEmail"></mbsc-input>
        <mbsc-input name="password" type="password" class="md-passw-field password" placeholder="Password" [(ngModel)]="loginPassword"></mbsc-input>
        <mbsc-button name="login" class="login_button" (click)="loginWithEmail()">Login</mbsc-button>
        </div>
    </mbsc-form>
</mbsc-widget>

Angular 4:

@ViewChild("emailLoginWidget") emailLoginForm: any;

Calling this.emailLoginForm doesn't reveal any available functions from mobiscroll. Am I missing an import? I'm not importing mobiscroll into the file.

Any help would be great, I cant find any documentation online that shows how to access a mobiscroll instanc.e


Solution

  • Use emailLoginForm.instance instead of emailLoginForm