AngularJs 内联检查数组是否检查 [英] AngularJs Inline Check if an array check

查看:27
本文介绍了AngularJs 内联检查数组是否检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AngularJs 中的内联有没有办法检查某些东西是否是数组?

Inline in AngularJs is there a way to check if something is an array?

我会认为这可行:

<div ng-show="Array.isArray(textStuff[0][1])">Hi</div>

我已经验证它实际上是一个数组.是否有我遗漏的东西或其他方式?

I have verified it is in fact an array. Is there something I am missing or another way?

推荐答案

你可以把 angular.isArray 放在作用域上...

You can put angular.isArray on the scope...

$scope.isArray = angular.isArray;

<小时>

<div ng-show="isArray(textStuff[0][1])">Hi</div>

小提琴

这篇关于AngularJs 内联检查数组是否检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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