I am right now working on a project which has lot of jquery code and i am migrating that to angular, but it needs to deliver as soon as possible(lack of time to change each piece of code).
Code looks like....
var app = angular.module('audiapp', ['ngResource']);
app.controller('audiLayoutCtrl', function ($scope, dataFactory) {
$scope.editbutton = function () {
//e.preventDefault();
var editable = $(this).parents('.editable');
editable.find('.editable-body').hide();
editable.find('.editable-form').show();
editable.find('.editable-toggle').hide();
};
}
here in this piece of code the editbutton function is getting called but jquery code inside is not working.
I am sorry if i am completly un reasonable as i am very new to angular js.
editbuttoncalled... you have to pass the even object toeditbuttonusingeditbutton($event)from your event handler likeng-click="editbutton($event)"thisineditbuttonmethod refers to $scope, not the element that is being clicked.