###前提・実現したいこと
いつもお世話になっております。
angularjs1+onsenuiV2の環境でmonacaでandroidアプリの開発をしております。
以下に記載するソースでholdイベントが発火した際にどのons-list-itemで発火したのか取得するにはどのように記述すればよいのでしょうか。
どなたかご教示いただけますでしょうか。
###該当のソースコード
html
1 2<ons-template id="tabNavi1.html"> 3 <ons-navigator id="tabNavi1" page="sample.html"></ons-navigator> 4</ons-template> 5 6<ons-template id="sample.html"> 7 <ons-page id="sample" ng-controller="sampleCtrl"> 8 <ons-list> 9 <ons-list-item class="item" modifier="chevron" ons-lazy-repeat="delegate" tappable> 10 <ons-row> 11 <ons-col> 12 <header> 13 <span class="title" ng-model="title">{{item.title}}</span> 14 <span class="label">{{item.updateDate}}</span> 15 </header> 16 </ons-col> 17 </ons-row> 18 </ons-list-item> 19 </ons-list> 20 </ons-page> 21</ons-template>
javascript
1ons.bootstrap() 2 .controller('sampleCtrl', function ($scope) { 3 ons.ready(function () { 4 tabNavi1.addEventListener('hold', function (event) { 5 ons.notification.confirm({ 6 title: '', 7 message: '選択中のアイテムを削除しますが、よろしいですか?', 8 buttonLabels: ['いいえ', 'はい'], 9 callback: function (index) { 10 if (index === 1) { 11 //どのons-list-itemがロングタップされた? 12 } 13 } 14 }); 15 }); 16 }); 17 });
あなたの回答
tips
プレビュー