Giter Site home page Giter Site logo

angular-prismicio's People

Contributors

awulder avatar dlecan avatar ghelton avatar karmats avatar paul-psdigital avatar rudyrigot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

angular-prismicio's Issues

prismic-html

I can't seem to get this to ever work.

I'm running a query in my controller and getting back good data. But the directive shows nothing (the

 tag at the end shows the results fine.)
controller code:
Prismic.query('[[:d = fulltext(my.product.name, "Coconut")]]').then(function(data) {
self.data = data;
}, function(err){
alert('error');
});

html code:

<prismic-html fragment="main.data.product.name"></prismic-html>
<pre> {{main.data | json}} </pre>

Getting cors error

I'm trying to use the service but getting an error about access control

OPTIONS https://lesbonneschoses.prismic.io/api (anonymous function) @ angular.js:10695sendReq @ angular.js:10514status.$get.serverRequest @ angular.js:10221processQueue @ angular.js:14678(anonymous function) @ angular.js:14694parent.$get.Scope.$eval @ angular.js:15922parent.$get.Scope.$digest @ angular.js:15733parent.$get.Scope.$apply @ angular.js:16030done @ angular.js:10545completeRequest @ angular.js:10717requestLoaded @ angular.js:10658
(index):1 XMLHttpRequest cannot load https://lesbonneschoses.prismic.io/api. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:9000' is therefore not allowed access. The response had HTTP status code 404.

I'm assuming there is an underlying error, but not sure what to do here.

TIA

Andrew

Some errors returned by server are lost

Some errors returned by server are lost when, for eg., a bad predicate is provided.

Prismic.all().then(function(data) {
   self.data = data;
   // If server error, data is null
});

If I want to chain several http calls, I can't chain promises because I need to test data content.

A better design is to handle error here and here and to reject the promise.

Strangely, this design is already used here and here.

Do you agree ?

Exposing ctx for use in views?

It could be useful, to use maybeRef in URLs that are built outside of a structured text fragment's serialization, or simply to build a URL from a document.

Ideally, it's be nice to just go: <a href="#/pricing{{ctx.maybeRef}}">...</a> or <a href="{{ctx.linkResolver(someDoc, ctx)}}">...</a>.

Make angular-prismic able to change access token on the fly

Hi

Since the Prismic service caches the Api and Context with maybeApi and maybeContex there is no clear way to effectively change the accessToken except in app.config() with the PrismicProvider object.

This means we have to do a full page reload/redirect when editors and publishers want to view different versions.

To be clear, while it is possible to use Prismic.setAccessToken() and also Prismic.configuration but when retrieving the context or api we get the cached with the old access token.

Suggestion, when using any of the setAccessToken etc. methods, make the maybeApi and maybeContext is cleared. So that the next request will fetch fresh data. I would also suggest broadcasting something.

If you think this is a good idea I can implement it.

Tag a release for bower

Thanks for writing this, going to try implementing today, can you tag a release for bower so I have a version to point to.

Not working with Prismic.io v 1.3.3

This directive no longer works after updating to Prismic.IO 1.3.3
They changed the return values from value to blocks.
I will continue to use 1.2.1 for now, but I'm hoping you can release a fix.

TIA

Add ordering to query

Hi,

Can you add an ordering method? Maybe something we can use like that :

Prismic.query(predicateBasedQueryString).order(orderingQueryString)

For now, I ended up using the api() method. It works fine, but it would be easier if there is a built-in method.

Thank you!

Using orderings, pageSize, page, etc. in calls

I'm looking into your library today, and I'm noticing that you are abstracting a lot how the kit performs queries. It's fine by itself, but it suppresses a key upside of the official kit: the ability to chain calls to specify your query. For instance:

api.forms('products').query('[[:d = at(document.tag, "featured")]]').orderings('[product.price]').pageSize(10).page(2).ref(ref).submit()

I wonder how best to expose this with the current approach. Maybe simply with a Prismic.api so that we can do stuff such as Prismic.api.forms('products').query('[[:d = at(document.tag, "featured")]]').orderings('[product.price]').pageSize(10).page(2).submit(). This might require to extend the original SearchForm object so that submit() returns a promise, but that could work!

Notice that I haven't used ref. I like the way you've abstracted the call to ref in a clean way, still making it possible to pass another ref in the page's URL.

I can totally make that happen, I just thought I'd reach out first to talk about how to do this best.

specify the form for a query

I'm trying to specify a particular form (not 'everything') for a query, but can't find any example or doc.
Should I use the Api (i.e. Prismic.Api) instead?
any help would be appreciated.

TIA,

Andrew

Any plan to put this on Bower/NPM?

Love the lib, especially the prismicHtml directive!!!

Would love to remove your lib from my repo, though. Did you have any plans to push this up to Bower (or other similar services)?

Support new API syntax

Hey there I started using this to try some Prismic in Angular however I see here its used a format of quering that is on the old docs

Prismic.query('[[:d = at(document.type, "venue")]]')

Whereas now the syntax is more like: prismic.Predicates.at('document.type', 'venue')

I know this hasn't been updated in a while but still I'd be nice.

Thanks for this awesome service though

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.