2014-09-13 5 views
0

저는 이오니아에서 초보자이며 div보다 슬쩍 제스처를 인식하고 싶습니다. 그러나이 경우 브라우저, 에뮬레이터 또는 장치에서 작동하지 않는 것처럼 보려는 경우이오니아 스 와이프 제스처가 인식되지 않습니다

<ion-view title="Charts - days"> 
    <ion-content class="padding"> 
    <h1>dede</h1> 
     <div class="row" on-touch="alert('right');"> 
      <div class="col" on-touch="alert('right');" style="background-color: red;">.col</div> 
     </div> 
     <button on-touch="alert('touch');" class="button">Test</button> 

    </ion-content> 
</ion-view> 

어떻게 해결할 수 있습니까?

어떤 조언을 주셔서 감사합니다.

답변

0

컨트롤러로 작업을 이동하여이를 해결했습니다. CodePen here을 볼 수 있습니다.

<ion-view title="Charts - days"> 
    <ion-content class="padding"> 
    <h1>dede</h1> 
     <div class="row" on-touch="myAlert()"> 
      <div class="col" on-touch="myAlert()" style="background-color: red;">.col</div> 
     </div> 
     <button on-touch="myAlert()" class="button">Test</button>  
    </ion-content> 
</ion-view> 
당신의 동반 자바 스크립트 파일에서

... $ 창을 주입하는 것은 필요하지 않다고

angular.module('ionicApp', ['ionic']) 
.controller('AppCtrl', function($scope,$window) { 
    $scope.myAlert = function() 
    { 
    $window.alert('right'); 
    } 
}); 

참고하지만 선 아래로 쉽게 단위 테스트를 만드는 않습니다.

관련 문제