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
}
这不起作用。
最佳答案
试试这个:-
obj = ['sha','abc','xyz] //javascript array
function myclrt($scope) //this angular js function
{
$scope.one = obj[0]; // Typo $Scope -> $scope
}
关于javascript - 将 javascript 数组值分配给 angularjs 变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27329906/