0

I have these functions that do calculations of values from input fields using ng-model.

 $scope.EmployeeCompetenceObs = function () {
      return $scope.user.percentEmployeesCompetentAfterTraining - $scope.user.percentEmployeesCompetentBeforeTraining;
  }

and what I am trying to do is get the value from that function and use it in another function:

$scope.EmployeeCompetenceAtt = function () {
      return EmployeeCompetenceObs() - $scope.user.adjustmentFactorsEmployeeCompetence;
  }

but when I call {{EmployeeCompetenceAtt()}} it comes up ad undefined...what am i doing wrong?

1
  • Shouldn't it be return $scope.EmployeeCompetenceObs()... and not return EmployeeCompetenceObs()...? Commented May 21, 2014 at 17:25

1 Answer 1

1

The EmployeeCompetenceObs is a function in the $scope, as you declared it, so you should invoke it by doing:

$scope.EmployeeCompetenceObs()

You omitted that part in your invocation and that is most likely the cause of the error.

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.