From b47ce62205575b22a07ccb7ec614fdb3cbf034b5 Mon Sep 17 00:00:00 2001 From: maanasa Date: Wed, 26 Mar 2014 17:45:30 +0530 Subject: [PATCH] Update typeahead-tests.ts Adding tests for including options --- typeahead/typeahead-tests.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/typeahead/typeahead-tests.ts b/typeahead/typeahead-tests.ts index 3a24fb152e..67fc8d31a3 100644 --- a/typeahead/typeahead-tests.ts +++ b/typeahead/typeahead-tests.ts @@ -72,15 +72,16 @@ $('.example-films .typeahead').typeahead([ } ]); -//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({ +// Countries - Modified the first test here to add options +// Specifies options to display hint with a highlight and adds a minimum length restriction for search +// Prefetches data, stores it in localStorage, and searches it on the client +$('.example-countries .typeahead').typeahead({ hint: true, highlight: true, - minLength: 1 + minLength: 2 }, { - name: 'states', - displayKey: 'value', - source: substringMatcher(states) + name: 'countries', + prefetch: '../data/countries.json', + limit: 10 });