some days ago i have tried to work with ng-if
even then my code works but now when i am trying it ,ng-if
not working
here is how i am doing inside ng-repeat
.
<tr ng-repeat="program in getProgram">
<td>{{$index+1}}</td>
<td>{{program.name}}</td>
<td>{{program.code}}</td>
<td>{{program.code2}}</td>
<td>{{program.ed}}</td>
<td ng-if="program.status == 'Published' ">{{program.status}}</td>
<td ng-if="program.status == 'Draft' ">{{program.status}}</td>
</tr>
i want to display either draft or published according to status.
even when i tried with
1=1 1=2
both values are getting printed.
It should work. Here is a plunkr:
http://plnkr.co/edit/CFyvY7JtQQiJIowUCc67?p=preview
this data:
![$scope.getProgram = \[{
name: 'Name1',
code: 'CodeN1',
code2: 'Code2N1',
ed: 'ED',
status: 'Published'
}, {
name: 'Name2',
code: 'CodeN2',
code2: 'Code2N2',
ed: 'ED2',
status: 'SomeOtherStatus'
}, {
name: 'Name3',
code: 'CodeN3',
code2: 'Code2N3',
ed: 'ED3',
status: 'Draft'
}, {
name: 'Name4',
code: 'CodeN4',
code2: 'Code2N4',
ed: 'ED4',
status: 'NOSHOW'
}\]][1]
Yields this
