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
Post a Comment