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 - ScrollTo Effect (href to div) -

javascript - ng-class not responding to change in model in Angular? -

javascript - document.registerElement extending HTMLInputElement prototype while using custom tag name to avoid implicit browser style -