I am new to AngularJS, and I got stuck on this ng-click when trying to set some parameters before uploading an image. Here is the code:
<div ng-controller="TestCtrl">
<div data-ng-click="readUploadedImage('grPhoto', '{{ id }}')">
<label class="changePhotoBtn" for="uploadBanner">Click Here</label>
<input style="display: none;" type="file" name="Upload a file" id="uploadBanner" />
</div>
</div>
var myApp = angular.module('myApp',[]);
function TestCtrl($scope) {
$scope.id = 1234;
$scope.readUploadedImage = function(parentClass, spid) {
alert(parentClass + ' ' + spid);
}
}
Link to Fiddle: http://jsfiddle.net/CMJkg/2/
function TestCtrl($scope)
tofunction MyCtrl($scope)
– Dhaval Marthak Oct 15 '13 at 13:19