0

I am calling a function from below:-

<a href="#" ng-click="editExpense('{{expense.Expense.id}}')">Edit</a>

In inspect element i am getting the id is '12'. but in function below:-

 $scope.editExpense = function(id){
     alert(id);
 }

Id is showing "expense.Expense.id".Then How can i pass the parameter. Is there any other way to call a function with angular js variables value.

1 Answer 1

4

You don't need to use curly brackets in a ngDirective.

<a href="#" ng-click="editExpense(expense.Expense.id)">Edit</a>
Sign up to request clarification or add additional context in comments.

2 Comments

Thanx, sir. You are genius.... you saved my times. I was trying it for two hours.
I had the same problem too when I started with angular :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.