I think I see a problem: .then()
expects a function reference, but you're invoking the function and passing-in the result (in this case, a Promise). Try this instead:
function doSearch() {
addCachedSearch($('#phrase').val())
.then(getCachedSearches);
}
Note that getCachedSearches
no longer has the ()
parens.
Just for kicks, here's a jsFiddle with a distilled example of what it appears you're trying to do: http://jsfiddle.net/UbBz3/