javascript - how to use if else condition in angularJs -


hi newly angular js, want convert am/pm format in javascript example ( 25-10-2013 18:30 25-10-2013 6:30 pm ) controller file

for (var = 0; < $scope.availableslots.length; i++)      $scope.availableslots[i].appointmentdate  = date.parse(moment($scope.availableslots[i].f).format('mm-dd-yyyy hh:mm')) ;  }  <div>     <button class="btn btn-danger"  ng-click="cancelappointment(appointment)">cancel</button> </div> 

here cancel button should appear if appointment date future date. otherwise, cancel button should hidden.

you using ng-show="isfutureday" attribute.

<button class="btn btn-danger"          ng-show="isfutureday"          ng-click="cancelappointment(appointment)">cancel</button> 

where isfutureday boolean variable in scope, indicates if appointment day future day or not. if future day, isfutureday===true, button visible. otherwise, invisible.

for further documentation ng-show, please have here.


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -