Move undefined check to correct place
This commit is contained in:
parent
1e0a919137
commit
873fbab56b
|
@ -62,14 +62,14 @@
|
||||||
},
|
},
|
||||||
templateResult: function(data) {
|
templateResult: function(data) {
|
||||||
// console.log(data);
|
// console.log(data);
|
||||||
if (typeof data.id === 'undefined') {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
var html = '';
|
var html = '';
|
||||||
if (data.type=='menu') {
|
if (data.type=='menu') {
|
||||||
html += '<a href="'+data.url+'"><div class="search-suggestion">';
|
html += '<a href="'+data.url+'"><div class="search-suggestion">';
|
||||||
html += '<span class="fa fa-'+data.icon+'"></span>'+data.text+'</div></a>';
|
html += '<span class="fa fa-'+data.icon+'"></span>'+data.text+'</div></a>';
|
||||||
} else {
|
} else {
|
||||||
|
if (typeof data.id === 'undefined') {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
html += '<div class="search-suggestion">';
|
html += '<div class="search-suggestion">';
|
||||||
html += '<div class="search-suggestion-item">'+data.text+' <span class="badge badge-pill badge-light">'+data.type+'</span></div>';
|
html += '<div class="search-suggestion-item">'+data.text+' <span class="badge badge-pill badge-light">'+data.type+'</span></div>';
|
||||||
html += '<div class="search-suggestion-options">';
|
html += '<div class="search-suggestion-options">';
|
||||||
|
|
Loading…
Reference in New Issue