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] not being assinged scope.one } 

this not working.

try this:-

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

Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -