Hello!
You could do it like this too:
<table>
<tr ng-repeat="x in names">
<td data-ng-show="x.Name == 'NAME'">{{ x.Name }}</td>
<td>{{ x.Country }}</td>
</tr>
</table>
Here's a plunker demo: http://plnkr.co/edit/Co6LFeu6EPrZMfQVkOs0?p=info
El martes, 12 de enero de 2016, 14:42:21 (UTC-3), pankaj Durve escribió:
>
> If i want to display name if name ==''JOHN"..How to use if condition
>
>
> <!DOCTYPE html>
> <html >
> <style>
> table, th , td {
> border: 1px solid grey;
> border-collapse: collapse;
> padding: 5px;
> }
> table tr:nth-child(odd) {
> background-color: #f1f1f1;
> }
> table tr:nth-child(even) {
> background-color: #ffffff;
> }
> </style>
> <script src="
> http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js
> "></script>
> <body>
>
> <div ng-app="myApp" ng-controller="customersCtrl">
>
> <table>
> <tr ng-repeat="x in names">
> <td>{{ x.Name }}</td>
> <td>{{ x.Country }}</td>
> </tr>
> </table>
>
> </div>
>
> <script>
> var app = angular.module('myApp', []);
> app.controller('customersCtrl', function($scope, $http) {
> $http.get("http://www.w3schools.com/angular/customers_mysql.php")
> .then(function (response) {$scope.names = response.data.records;});
> });
> </script>
>
> </body>
> </html>
>
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.