From 64bd6c8132f7daf0f306f156fd68127ea4eef3e7 Mon Sep 17 00:00:00 2001 From: maanasa Date: Wed, 26 Mar 2014 17:04:20 +0530 Subject: [PATCH] Update typeahead-tests.ts --- typeahead/typeahead-tests.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/typeahead/typeahead-tests.ts b/typeahead/typeahead-tests.ts index f93049a447..3a24fb152e 100644 --- a/typeahead/typeahead-tests.ts +++ b/typeahead/typeahead-tests.ts @@ -71,3 +71,16 @@ $('.example-films .typeahead').typeahead([ engine: Hogan } ]); + +//Basic substring search +//Specifies options along with datasets. In this case the dataset uses a custom substring matcher function as its source +$('#the-basics .typeahead').typeahead({ + hint: true, + highlight: true, + minLength: 1 +}, +{ + name: 'states', + displayKey: 'value', + source: substringMatcher(states) +});