說我有一些文字,如:渲染只有{{變量}}定義
The data is ready. Here it is: {{something}}
我想只渲染行,如果something
不undefined
。我怎樣才能做到這一點?
萬一有幫助,這裏是在更廣闊的背景下,線:
<html>
<body>
<div>
<div class='container-fluid' ng-controller="TypeaheadCtrl">
<input type="text" ng-model="selected"
typeahead="name_and_uid as item.name_and_uid for item in items |
filter:{name_and_uid: $viewValue} | limitTo:16"
typeahead-on-select='onSelect($item, $model, $label)' class="form-control">
The data is ready. Here it is: {{name_and_uid}}
</div>
</body>
</html>
其中{{name_and_uid}}
選擇完成後才能確定。
目前,我在獲得"The data is ready. Here it is:"
之前做出選擇。我只希望在我輸入並進行選擇後呈現。
非常行之有效。謝謝 – 2014-12-11 21:35:24