Ng-blur, ng-focus and Ionic 2?


#1

Hi,

Can anyone tell me why I’m not triggering the focus and unfocused events on my input?

Thanks

<ion-input ng-focus="visitingInput()" ng-blur="visitedInput()"></ion-input>

visitingInput()
{
    console.log("hit");
}

visitedInput()
{
    console.log("hit2");
}

Socket.io and background and foreground
#2

Because Ionic 2 is based Angular 2, and Angular 2 has no ng-focus directive. You’ll want to use the event binding syntax instead.


#3

thanks, (focus) and (blur) worked.