angularjs - ng-if date comparison using the == operator -
ng-if="{{(date | date:"dd/mm/yyyy") == (question.datetimeend | date:"dd/mm/yyyy")}}"
i have expression $scope.date = new date()
.
i parser error . wondering if can achieved using ==
operator in mustache expression
itself.
try this. don't need {{}} in ng-if , "" in date format.
ng-if="(date | date:'dd/mm/yyyy') == (question.datetimeend | date:'dd/mm/yyyy')"
var app = angular.module('app', []); app.controller('mainctrl', function($scope) { $scope.date = '20160313t00:00:00'; $scope.datetimeend = '20160313t00:00:00'; });
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> <div ng-app="app" ng-controller="mainctrl"> <p ng-if="(date | date:'dd/mm/yyyy') == (datetimeend | date:'dd/mm/yyyy')" ng-bind="datetimeend | date:'dd/mm/yyyy'"></p> </div>
Comments
Post a Comment