Comments (7)
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.
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.
Thanks @davemo, so there isn't a way you thought of to avoid that extra HTTP request?
from end-to-end-with-angularjs.
Inlining the value in a server-side template would be the only way to avoid that request @sdeering :)
from end-to-end-with-angularjs.
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.
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.
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)
- Prevent the access to home.html if user is not logged in. HOT 9
- Newer Laravel versions break authentication HOT 2
- auth/login not found HOT 1
- composer install error HOT 13
- Accessing the laravel routes using restangular.
- Auth::user() session not maintain in every page HOT 1
- DB Migration for the sessions table missing HOT 2
- Installation instructions - step 5 seems redundant (and causes an error) HOT 1
- update data provided by a service HOT 2
- html5Mode doesnt seem to work HOT 1
- How to install this on Windows? HOT 1
- Passing the Credentials static HOT 1
- "Follow the linking instructions for php55 that you see in brew info php55" HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from end-to-end-with-angularjs.