1

I have an ionic angular template file like this:

<ion-list>
<!-- Search Hotels -->
<div class="list list-inset">
  <label class="item item-input">
    <i class="icon ion-search placeholder-icon"></i>
    <input type="text" placeholder="Search" ng-model="hotelSearch" ng-focus="tap.focus()" ng-blur="tap.blur()">
  </label>
</div>

<!-- List of Hotels -->
<ion-item class="item-remove-animate item-avatar item-icon-right" ng-repeat="hotel in hotels |filter: hotelSearch | orderBy: '-popularity' | limitTo: 10" type="item-text-wrap" href="#/tab/hotels/{{hotel.id}}" ng-show="tap.tapped">
  <img ng-src="">
  <h2>{{hotel.name}}</h2>
</ion-item>

It works perfectly when I use it in browser using ionic serve. But fails in android simulator. the ng-focus can be simulated by using on-tap.

What is the equivalent of ng-blur in ionicframework?

Nasif Md. Tanjim
  • 3,862
  • 4
  • 28
  • 38

2 Answers2

0

Just use

onblur="fnx()"

It may work!!

Paolo Stefan
  • 10,112
  • 5
  • 45
  • 64
Kais
  • 1,925
  • 3
  • 23
  • 35
0

This answer pointed me in the right direction: if you defined a similar function in your controller:

$scope.blurCallback = function(){
    // do some amazing stuff here ...
}

then in your markup you can use:

<input ... onblur="angular.element(this).scope().blurCallback()">
Community
  • 1
  • 1
Paolo Stefan
  • 10,112
  • 5
  • 45
  • 64