0

working with asp page and I need to change "true-false" statement on table. But I couldn't figure out how to add "string" instead of boolen data on asp page. That's asp code block, which I need to change it.

 <tr data-ng-repeat=" ticket in ticketList">
                                    <td>{{ticket.UserId}}</td>
                                    <td>{{ticket.State}}</td>
                                    <td>

I tried to do that

 <td>{{<%# ((bool)Eval("ticket.State") != false) ? "Tested" : "NotYet" %>}}</td>

but, It doesn't work. how can I put a conditional statement into that cod block. Thanks for any advice.

ramiramilu
  • 17,044
  • 6
  • 49
  • 66
Semih Gokceoglu
  • 1,408
  • 1
  • 13
  • 21

1 Answers1

0

Since this is angluar JS app, you can not use <%# Eval .. %> thing here. You might have noticed that you are using loop with ticket in ticketList in data-ng-repeat.Point is you can not apply server side implementation for rendering there. You need to do in angularjs way. Following are some examples to do it.

If you have angularjs version >= 1.1.5, then following way would work.

<td>{{ticket.State === "false" ? "Tested" : "NotYet"}}</td>

For lower version, this will be helpful - inline conditionals in angular.js

Or there are other directives like ng-show, ng-hide, ng-switch, you can try those too!

Community
  • 1
  • 1
Arindam Nayak
  • 7,346
  • 4
  • 32
  • 48