1
obj = ['sha','abc','xyz] //javascript array

function myclrt($scope) //this angular js function
{
    $Scope.one = obj[0]; // obj[0] is not being assinged to scope.one
}

This is not working.

2
  • i want to assign 'sha'(viz obj[0]) to $scope.one (which is angularjs variable) Commented Dec 6, 2014 at 9:10
  • Typo, try $scope instead of $Scope. Commented Dec 6, 2014 at 10:52

1 Answer 1

1

Try This:-

obj = ['sha','abc','xyz] //javascript array
function myclrt($scope) //this angular js function
{
   $scope.one = obj[0]; // Typo $Scope -> $scope
}
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.