2

I am working with dynamic web, this connected to websocket, then when my web load, i call a load.php (with angular directive).

This web(load.php) makes a select in mySQL (i have many tables, linked when id).

Then I make a left join in all tables and I get a unidimensinal array with info about all tables.

Next i show all data with angularjs, each table in different div, where if TABLEX_VALUE!='null' -->ng-show, eq:

<div ng-repeat="data in alldata">
       <div ng-show="TABLEX_VALUE!='null'">
           {{data.TABLEX_VALUE1}}  - {{data.TABLEX_VALUE2}}
      </div>
     <div ng-show="TABLEY_VALUE!='null'">
           {{data.TABLEY_VALUE1}}  - {{data.TABLEY_VALUE2}}
      </div>
         .
         .
         .
         .
      <div ng-show="TABLEZ_VALUE!='null'">
           {{data.TABLEZ_VALUE1}}  - {{data.TABLEZ_VALUE2}}
      </div>
</div>

How do I count all tables where TABLEX_VALUE!='null'?

Sze-Hung Daniel Tsui
  • 2,282
  • 13
  • 20
jearca
  • 235
  • 1
  • 4
  • 13

1 Answers1

0

Try using $filter to get all the elements with your desired values, and look for the length of the resulting array.

See the docs, and two previous questions, which are related but aren't asking the same thing.

You're looking for the JavaScript pattern:

$filter('filter')(array, expression, comparator)

Community
  • 1
  • 1
Sze-Hung Daniel Tsui
  • 2,282
  • 13
  • 20