webcss / angular-indexedDB

An angularjs serviceprovider to utilize indexedDB with angular
149 stars 99 forks source link

no method '$index' #9

Closed simonced closed 10 years ago

simonced commented 10 years ago

I'm liking that lib so far, but I have troubles with the queryBuilder. I'm using something like: var myQuery = $indexedDB.queryBuilder.$index('class_idx').$eq(classid).compile; But in the console, I have a big error: TypeError: Object function () { return new QueryBuilder(); } has no method '$index' I can use "getAll()" and such, but not that $index, to then loop with "each()" on the found results... Any idea? Thanks.

webcss commented 10 years ago

You missed the parantheses in function calls $indexedDB.queryBuilder()....compile(); Try this: var myQuery = $indexedDB.queryBuilder().$index('class_idx').$eq(classid).compile();

simonced commented 10 years ago

Actually, I doublechecked, and I didn't see I also forgot () to querybuilder! I'm sorry, it works great now! Thank you! ;-)