Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49220

Ionicmodal children DOM manipulation

$
0
0

@dreyer wrote:

Hello.

I getting in trouble trying to add a click event for an element in my modal...
Its inside a directive to avoid repeat the same code on each controller. Thats why I wanna set the click here too, to avoid create the same clickevent in every controller.

$ionicModal.fromTemplateUrl('views/modal-info/'+view, {
scope: $scope,
animation: 'slide-in-up'
}).then(function(modal) {
$scope.modal = modal;
modal.show();
modal.$el.find('fieldset').on("click", function(event){
console.log(event);
});
});

if I console.log($el), I can navigate through childNodes until the fieldset I want, but the .find() never finds anything. No matter what I try to find (I tried with also with the same result).

What am I doing wrong? Or is there another good way to make it?

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49220

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>