Angular Directive for a typeahead using a trie data structure