0

I want to update argument of ng-click of button but not able to do it please help me... my code is in controller

$scope.trCategoryId = 0;

and setting up this value in other function like

$scope.setClick = function (CategoryId) {
$scope.trCategoryId = CategoryId;}

in html i have define bellow

<button ng-click="ActiveTag('step1',{{trCategoryId}},0)" id="btnrename">Create</button>

it is not calling up ActiveTag function

5
  • are they on the same scope? why don't you just use trCategoryId on your ActiveTag function? Commented Jul 29, 2016 at 12:50
  • {{trCategoryId}} within any ng- is a no-no. It evaluates variable names against scope inside automatically, no need for the {{}}. Commented Jul 29, 2016 at 12:57
  • firstly remove {{}}. in addition can you show your ActiveTag function? Commented Jul 29, 2016 at 13:12
  • this is my activetag function $scope.ActiveTag = function (id, categoryid, rename) { if (categoryid != undefined) if (id != 'step1') if (id == 'step1' && rename == null) { $('#myModal').modal('toggle'); $('#myModal').modal('show'); $('#myUpdateModal').modal('hide'); } if (id == "step1" && rename == 0) { $('#myModal').modal('hide'); $('#myUpdateModal').modal('toggle'); $('#myUpdateModal').modal('show'); } else { $("#" + id).show() }; } Commented Jul 29, 2016 at 13:21
  • after removing{{}} problem is solved Thanks for help Commented Jul 29, 2016 at 13:25

1 Answer 1

1

Glad my comment worked out for you, adding it below as a solution:

Angular related attributes prefaced with ng- auto evaulate so {{trCategoryId}} within any ng- is a no-no. It evaluates variable names against scope inside automatically, no need for the {{}}.

<button ng-click="ActiveTag('step1',trCategoryId,0)" id="btnrename">Create</button>
Sign up to request clarification or add additional context in comments.

Comments

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.