angularjs - Angular Inline Conditional on ng-bind -
i'm trying pagetitle initialise data.products[whichitem].date if condition true or pagetitle = data.products[whichitem].valuetoday if condition false there ng-directive more appropriate or syntax wrong
<section ng-bind="(true) '{{pagetitle = data.products[whichitem].date | getyear}}' : '{{pagetitle = data.products[whichitem].valuetoday}}' " ></section>
do want print pagetitle
value or assign value pagetitle
.?
you can things in controller. ng-bind
print value in page
$scope.setpagetitle(data,itemindex){ $scope.pagetitle = <condition> ? data.products[itemindex].date : data.products[itemindex].valuetoday; }
then if want print it. <section ng-bind='pagetitle'></section>
use this.
Comments
Post a Comment