awulder/angular-prismicio — pull request #13 by rudyrigot (2014-06-03 23:39:29+00:00)
Title: Exposing api and ctx in order to make advanced queries

This would solve #10 and #11, but I'm fairly new to Angular JS, so let me know if you feel the way I've done it is relevant.

Also, I have left the non-promise form of `submit()` that is in the kit, but we can change that.
An idea how: extending the `Api` class into an `ApiWithPromise` class, and extending the `SearchForm` class into a `SearchFormWithPromise` class. The only differences are: `ApiWithPromise.form(formName)` returns a `SearchFormWithPromise` instead of just a `SearchForm`, and `SearchFormWithPromise.submit()` returns a promise instead of taking a callback. And of course, `Prismic.api()` would return an `ApiWithPromise` object.
Not sure it's the best way to make it happen; we could also monkey-patch stuff but I'm not sure it would be as clean. Not even sure it's relevant to want to make that callback into a promise. Let me know what you think!