check null,empty or undefined angularjs

前端 未结 7 520
广开言路
广开言路 2021-02-02 07:34

I am creating a project using angularjs.I have variable like

$scope.test = null
$scope.test = undefined
$scope.test = \"\"

I want to check all

7条回答
  •  自闭症患者
    2021-02-02 08:10

    You can also do a simple check using function,

    $scope.isNullOrEmptyOrUndefined = function (value) {
        return !value;
    }
    

提交回复
热议问题