{{value}} Maybe something like: " /> {{value}} Maybe something like: " /> {{value}} Maybe something like: "/>

AngularJS: Is there a convenient way to show and bind on an element if value is defined?

73 Views Asked by At

I am looking for one line syntax for this:

<span ng-if="value">{{value}}</span>

Maybe something like:

<span ng-bind-if="value"></span>
1

There are 1 best solutions below

0
TGH On

If saving characters is important I would recommend creating a custom directive and handle the logic internally.

<span my-hide-if-undefined="value"></span>