0

Hi I have annoying problem. I am trying to add two methods to $scope. And I am doing this right this:

function typeCtrl ($scope, $timeout) {    
  $scope.addType = function(){
      requestHelper.addType();
  };
  $scope.removeType = function(number){
      alert("asdasdsad");
      requestHelper.removeType(number);
  };
 };

And I am trying to call it this way:

<button id="addType" class="btn btn-primary glyphicon glyphicon-plus" ng-click="addType()"></button>
<button id="removeRequest" class="btn btn-danger glyphicon glyphicon-minus" ng-click="removeType(1)"></button>

A method addType() works correctly but angular not see removeType() method. Can you tell me whay I am doing wrong. Thanks for replies.

1
  • 1
    Can you generate a JSFiddle to isolate this problem. Off hand I don't see anything you're doing incorrectly. Commented Nov 29, 2013 at 17:58

1 Answer 1

2

Can it be because of no end-bracket on first 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.