假设我有一些文本,例如:
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>
where{{name_and_uid}}
仅在选择完成后定义。
目前,我"The data is ready. Here it is:"
在做出选择之前得到。我只希望在我输入并做出选择后呈现它。