Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/363.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript ng隐藏不';异步apiService调用后无法从类中删除_Javascript_Angularjs - Fatal编程技术网

Javascript ng隐藏不';异步apiService调用后无法从类中删除

Javascript ng隐藏不';异步apiService调用后无法从类中删除,javascript,angularjs,Javascript,Angularjs,我的作用域中有一个数组,由ui选择触发的服务调用填充: <ui-select search-enabled="true" ng-model="$parent.CurrentUser.ClubOrganization" ng-change="$parent.ClubOrganization_Change()" theme="select2" append-to-body="true"></ui-select> 您可以看到,ng repeat起作用,ng hide属性为f

我的作用域中有一个数组,由
ui选择触发的服务调用填充:

<ui-select search-enabled="true" ng-model="$parent.CurrentUser.ClubOrganization" ng-change="$parent.ClubOrganization_Change()" theme="select2" append-to-body="true"></ui-select>

您可以看到,
ng repeat
起作用,
ng hide
属性为false,但
ng hide
类仍在class属性中:

<div class="block block-bordered ng-hide" ng-hide="false" aria-hidden="true">
但是当触发$scope.ClubOrganization\u更改时,我检索到以下错误:

angular.js:12416 Error: [$rootScope:inprog] $digest already in progress
http://errors.angularjs.org/1.4.5/$rootScope/inprog?p0=%24digest
    at angular.js:68
    at beginPhase (angular.js:16235)
    at Scope.$apply (angular.js:15976)
    at userModalController.js:222
    at angular.js:10215
    at processQueue (angular.js:14634)
    at angular.js:14650
    at Scope.$eval (angular.js:15878)
    at Scope.$digest (angular.js:15689)
    at Scope.$apply (angular.js:15986)

我做错了什么

ng hide
/
ng show
的表达式值中不应包含
{}
,您可以将其简化为以下内容

ng-hide="!$parent.TeamTypes.length"
注意:在HTML上引用scope变量时使用
$parent
,不正确;在定义模型时,不要使用<代码>控件> <代码>模式>强>或<强> >代码>点规则< /代码>。
ng hide
/
ng show
的表达式值中不应包含
{}
,您可以将其简化为以下内容

ng-hide="!$parent.TeamTypes.length"
注意:在HTML上引用scope变量时使用
$parent
,不正确;在定义模型时,不要使用<代码>控件> <代码>模式>强>或<强> >代码>点规则< /代码>。
@我很高兴知道这有帮助。。谢谢:-)@inferon很高兴知道这有帮助。。谢谢:-)
$scope.GetTeamTypes = function (organizationId) {
        apiService.GetTeamTypes(organizationId).success(function (response) {
            $scope.TeamTypes = response;
            $scope.$apply();
        });

    };
angular.js:12416 Error: [$rootScope:inprog] $digest already in progress
http://errors.angularjs.org/1.4.5/$rootScope/inprog?p0=%24digest
    at angular.js:68
    at beginPhase (angular.js:16235)
    at Scope.$apply (angular.js:15976)
    at userModalController.js:222
    at angular.js:10215
    at processQueue (angular.js:14634)
    at angular.js:14650
    at Scope.$eval (angular.js:15878)
    at Scope.$digest (angular.js:15689)
    at Scope.$apply (angular.js:15986)
ng-hide="!$parent.TeamTypes.length"