How can I conditionally apply title in angular.js
<span title=" Create " class="check-{{ item.status }}"></span>
If status equals to true, then I want to show title as Create else Delete.
For class I can apply conditions like
ng-class="{true: 'active'}[isActive]
and in controller
$scope.isActive = true;
or
$scope.isActive = false;
How can I do the same in title?
I tried something like:
title = " item.status = true | 'create' "
Just do this
<span title="{{ item.status ? 'create' : 'delete'}}" class="check-{{ item.status }}"></span>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句