Single Instance Shared Data Service breaks ion-toggle in RC0


#1

Short description of the problem:

When I tap on an ion-toggle component on the Settings page on my app I get redirected to the rootpage (AccountListPage). This should not happen.

What behavior are you expecting?

When I tap on an ion-toggle component I expect to stay on the Settings page and not be redirected to another page

Animated GIF Demostrating Issue
moneyleash_issue_01

Steps to reproduce:

  1. Git clone the following repo: MoneyLeash2
  2. run npm install
  3. run ionic serve

settings.html

<ion-toggle [(ngModel)]="userSettings.enabletouchid" (click)="toggleTouchID()" checked="{{ userSettings?.enabletouchid }}"></ion-toggle>

Complete markup for settings.html

settings.ts

toggleTouchID() {
    console.log(this.userSettings.enabletouchid);
    this.userData.updateTouchID(this.userSettings.enabletouchid);
    this.userData.setEnableTouchID(this.userSettings.enabletouchid);
}

Complete code for settings.ts

user-data.ts

updateTouchID(ischecked: boolean): any {
    this.userdata.child(firebase.auth().currentUser.uid).update({'enabletouchid' : ischecked});
}

Complete code for user-data.ts

Other information:
No console errors are shown

Which Ionic Version? 2.x

Run ionic info from terminal/cmd prompt:

Your system information:

Cordova CLI: 6.3.0
Gulp version: CLI version 3.9.0
Gulp local:
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS: Windows 7 SP1
Node Version: v6.7.0


#2

UPDATE
I discovered that by removing the shared data service UserData (user-data.ts) from the login page (login.ts) the ion-toggle works as expected.

Why can’t I use a shared data service? Why does the ion-toggle break?