Could I please receive assistance with creating a list of suggested tags that will only appear beneath an input field once the user starts typing in it? The current setup includes:
jade
div.form-group
input#tags.form-control(name="tags", ng-model="query")
div.form-group
ul.suggested-tags
li(ng-repeat="tag in tags | filter:query") {{tag.name}}
accompanied by this JS script:
controller('TagsCtrl', function ($scope) {
$scope.tags = [
{
"name": "Foo",
"id": "foo"
},
{
"name": "Bar",
"id": "bar"
}
]
})
How can I adjust the code to set tags to []
if query
is null
?