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

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -