简体   繁体   中英

Showing link using Ternary Operator

How can this be achieved in partial html file ?

{{x.stringData > 50 ? <a ng-click="showData(x)">...</a> | '' }}

Obviously the above is not correct so its just for understanding that what I want to achieve.

you could use ng-if attribute.

for example:

<a ng-click="showData(x)" ng-if="x.stringData.length > 50">...</a>

Resource: https://docs.angularjs.org/api/ng/directive/ngIf

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM