shashank jaiswal
shashank jaiswal

Reputation: 35

assign javascript array value to angularjs variable

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.

Upvotes: 1

Views: 1622

Answers (1)

Bose_geek
Bose_geek

Reputation: 498

Try This:-

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

Upvotes: 1

Related Questions