我是新来的角。 我有一个函数,我需要设置ng-show变量为true或false为多个div。
该函数看起来像这样。
$scope.setDivFlags = function(divname,isShow){
if (isShow)
{$scope.<divname> = true;}
else
{$scope.<divname> = false;}
};
我所需要的值进行设置是这样的:
$scope.div1 = true;
$scope.div2 = true;
等等....
如何通过DIV1,DIV2 ...等动态。
你尝试'$范围[divname]'? –