Angularjs ng显示js asp.net

Angularjs ng显示js asp.net,angularjs,asp.net-mvc-4,Angularjs,Asp.net Mvc 4,我通过api rest接收一个json对象,如果我有位置,我想用ng show显示这个象形图 json: 控制器: $scope.LoadAllSpots = function (){ SpotConfigurationService.GetListSpots(function (datas) { $scope.CAMs = datas; console.log(datas); }, function (datas

我通过api rest接收一个json对象,如果我有位置,我想用ng show显示这个象形图 json:

控制器:

 $scope.LoadAllSpots = function (){
        SpotConfigurationService.GetListSpots(function (datas) {
            $scope.CAMs = datas;
            console.log(datas);
        }, function (datas) {

        });
  }
directive :


template: '<div>' + 
                 '  <div class="titles" ng-class="{true: \'SelectedAccordionStyle\',false:\'\'}[showMe]"><span class="svg_Red_Heading" ng-show ="!CAMs[0].place" > <img class="Svg-PictoRougeHeading" src="/Resources/Common/alerte.svg"/></span> {{title}} <a class="more-less glyphicon glyphicon-plus" ng-class="{true: \'glyphicon glyphicon-minus\', false:\'glyphicon glyphicon-plus\'}[showMe]" data-ng-click="OpenAccordion()"></a><button  ng-show ="showMe"> {{loadedFilter | i18n :\'ConfigurationSpotCAMValid\':\'Validate the entry\'}}</button> </div>' +
                '<div data-ng-show="showMe" data-ng-transclude=""></div>' +
                '</div>',
$scope.LoadAllSpots=函数(){
SpotConfigurationService.GetListSpots(函数(数据){
$scope.CAMs=数据;
控制台日志(数据);
},函数(数据){
});
}
指令:
模板:“”
“{{title}}{loadedFilter | i18n:\'ConfigurationSpotCAMValid\':\'Validate the entry\'}”+
'' +
'',

您可以在控制器内检查,并在满足条件时为变量赋值

for (var s in $scope.CAMs {
    if (SoftwareBadges[s]["place"])
        $scope.showme = true;
}

angular标记用于Angular2+项目,而您的标记为1+,将其更改为angularjs pleaseokey deblaton youhelllo saajjtharan,$scope.ShowConfiguration=function(){for(var s in$scope.CAMs){if(softwaredBadges[s][“place”])$scope.showme=true;}我如何在模板中做到请我做到这一点bu软件徽章它是什么请:但我想显示picto当我有我的json不免费的地方
for (var s in $scope.CAMs {
    if (SoftwareBadges[s]["place"])
        $scope.showme = true;
}