NG-如果 - 检查空值 [英] ng-if - checking for null value

查看:169
本文介绍了NG-如果 - 检查空值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有过一个数据集运行,并确定该文件夹设置为A HREF循环。我有一个NG-如果每一个选项,但我需要一个检查添加到NG-IFS之一。我需要一种方法来检查,如果一个值为null。我用这样的:

I have a loop that runs through a data set and determines the folder setup for a href. I have a ng-if for each of the options but I need to add a check to one of the ng-ifs. I need a way to check if a value is null. I have used something like:

 ng-if="!shortcut.SAM3Link" 

这里的问题是,如果在我的数据库中的值不为空,但没有一个值时,它不能识别的差异。我需要一种方法来专门检查空,而不是没有价值。

The problem with this is that if a value in my database is not null but does not have a value it does not recognize the difference. I need a way to specifically check for null rather than not having a value.

基本上我需要一种方法在我的数据库和文本/空白NULL值之间,以确定使用NG-IF。

Basically I need a way to determine between a NULL value in my database and text/blank using a ng-if.

推荐答案

您需要使用全等运算符 shortcut.SAM3Link ===空

ng-if="shortcut.SAM3Link === null" 

这篇关于NG-如果 - 检查空值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆