Hello,
I have this issue I dont know if it’s an ionic 2 bug or if I need support
Ionic version: 2.x
Current behavior:
I have a menu in my app, and when I logged out, I want to set LoginPage as root page.
this.nav.setRoot(LoginPage);
But I have below error :
Error:
\node_modules\ionic-angular\util\dom-controller.js:94 Uncaught TypeError: Cannot read property 'ev' of null
at Content.readDimensions (\node_modules\ionic-angular\components\content\content.js:518)
at dispatch (\node_modules\ionic-angular\util\dom-controller.js:103)
at DomController.flush (\node_modules\ionic-angular\util\dom-controller.js:84)
at rafCallback (\node_modules\ionic-angular\util\dom-controller.js:77)
Content.readDimensions @ \node_modules\ionic-angular\components\content\content.js:518
dispatch @ \node_modules\ionic-angular\util\dom-controller.js:103
DomController.flush @ \node_modules\ionic-angular\util\dom-controller.js:84
rafCallback @ \node_modules\ionic-angular\util\dom-controller.js:77
\node_modules\ionic-angular\animations\animation.js:291 Uncaught TypeError: _this._raf is not a function
at eval (\node_modules\ionic-angular\animations\animation.js:291)
Related code:
import { Component, ViewChild} from '@angular/core';
import { Platform, Nav, LoadingController, MenuController,Events} from 'ionic-angular';
import {HomePage} from '../pages/home/home';
import {LoginPage} from '../pages/login/login';
import {UserService} from '../services/user.service';
@Component({
templateUrl: 'app.html'
})
export class App {
@ViewChild(Nav) nav:Nav;
rootPage: any=HomePage;
constructor(public userService:UserService)
{
......
}
doLogout()
{
this.userService.doLogout().subscribe(res=>{
if(res.success)
{
localStorage.removeItem('isLoggedIn');
localStorage.removeItem('loggedUserInfo');
this.menu.close();
this.nav.setRoot(LoginPage);
}
});
}
}
Ionic info::
Cordova CLI: 6.3.1
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 0.0.4
ios-deploy version: Not installe
ios-sim version: Not installed
OS: Windows 7
Node Version: v4.6.0
Xcode version: Not installed```