0

I have in the View several models called dia1 dia2, etc. I'm trying to invoke them from the controller dynamically in the following way

for(i=1; i<=7; i++){
  Console.log($scope.day[i]);
}

It always shows as NULL or NaN

Thank you in advance for your precious help !!!

1 Answer 1

1

$scope.day is not an array, since you described having variables such as day1, day2...

You can access them like so:
$scope['day' + i]

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.