2016-08-09 2 views
0

だからとして2つのスパンを結合する三項演算子を使用しようとしています:1スパンでの3角形の場合の角度 -

<span ng-if="customer != null">{{ customer }}</span><span ng-if="customer == null">[customer]</span> 

スイッチがちょうどidが値を持っている場合や他の場所ではない形での入力に基づいています。提案?

ありがとうございました。

<span>{{ (customer != null) ? customer : '[customer]' }}</span> 

のように書くこともできます:

+0

あなたは 'NG-switch'を探していますか? – plong0

答えて

2

のような何かがあなたの意味だ

<span>{{ customer || '[customer]' }}</span>