Giter Club home page Giter Club logo

Comments (7)

davemo avatar davemo commented on June 2, 2024

Hey @sdeering, I've used the following technique to achieve what you're talking about:

https://gist.github.com/davemo/6141699

from end-to-end-with-angularjs.

davemo avatar davemo commented on June 2, 2024

Keep in mind you will need to setup your angular app to manual bootstrap using this approach. https://docs.angularjs.org/api/ng/function/angular.bootstrap

from end-to-end-with-angularjs.

sdeering avatar sdeering commented on June 2, 2024

Thanks @davemo, so there isn't a way you thought of to avoid that extra HTTP request?

from end-to-end-with-angularjs.

davemo avatar davemo commented on June 2, 2024

Inlining the value in a server-side template would be the only way to avoid that request @sdeering :)

from end-to-end-with-angularjs.

sdeering avatar sdeering commented on June 2, 2024

Just did a quick blog post on this. @davemo keen to hear what you think mate. http://angularjs4u.com/concepts/laravel-4-angularjs-architecture/

from end-to-end-with-angularjs.

davemo avatar davemo commented on June 2, 2024

Nice work @sdeering! I just read your post; how you handled the CSRF_TOKEN between dev/prod makes sense, it's basically the same split of client/server assets. Injecting the meta tag for your prod build is a nice way to handle avoiding that HTTP request for the token. I'm curious though, the post didn't go into detail on how you configured bootstrapping to be manual with the requested token vs automatic with the injected token. How are you achieving that part of the setup?

from end-to-end-with-angularjs.

sdeering avatar sdeering commented on June 2, 2024

Thanks @davemo yeah for that bit I just checked to see if the meta tag exists. https://gist.github.com/sdeering/4356baed3692d26ab778

from end-to-end-with-angularjs.

Related Issues (14)

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.