AngularJS Nested IF



我正试图用几个嵌套的If语句为我的控制器添加一些逻辑。它们本身工作得很好,但在嵌套它们之后,我没有得到任何结果。

这是一份工作声明:

            if (typeof object["Frequency"]!='undefined' && object["Frequency"]=='yearly' && ('now' <= 'upcoming')) {
            $scope.summary[segment].totalLateRelationships++;
            $scope.summary[segment].lateRelationships.push(object);
        } 

这是有效的:

            if (!(object["nextmeetingowner"].length) || !(object["nextmeetingowner"].length) ) {
                $scope.summary[segment].totalLateRelationships++;
                $scope.summary[segment].lateRelationships.push(object);
            }

这就是我正在努力实现的目标:

            if (!(object["primaryaccountability"].length) || (!(object["nextmeetingowner"].length))) {
          if  (typeof object["Frequency"]!='undefined' && object["Frequency"]=='yearly' && ('now' <= 'upcoming'))
            {
                $scope.summary[segment].totalLateRelationships++;
                $scope.summary[segment].lateRelationships.push(object);
            }
        }

第三个代码块正在检查与前两个不同的内容。正在评估

!(object["primaryaccountability"].length)

而早期的代码正在评估

!(object["Last Meeting Date"].length)

最新更新