说我有一些文字,如:渲染只有{{变量}}定义
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