Using elasticsearch.js with Angular.js