javascript - Calling a function in ng-repeat -


i have <input type="file"> in ng-repeat , want call function whenever value of element changes <input type="file"> element in ng-repeat.

i tried calling $(#"id").change() function not working. have tried using ng-change, ng-repeat doesnt work when use ng-change. code:

in html

<div ng-repeat="item in items">     <input  type="file" accept="image/*" id="add_{{$index}}"/> </div> 

in js

$("#add_images").change(function() {     alert("hi"); } 

why mixing angular , jquery?

you have in angular can use easily!

in html

<div ng-repeat="item in items">     <input  type="file" accept="image/*" id="add_images" ng-change="dosomething()"/> </div> 

in controller js

$scope.dosomething = function(){   //do whatever want } 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -