What do you think is the best way to create a SPA with Play?
Using google closure templates?
Using the plovr module?
Defining a REST API?
Kind regards
Johannes
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/W1MdLYBvo3wJ.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
I agree with sas. Plus you would be ready for plenty of integration options and types of clients.
[]s,
Paulo "JCranky" Siqueira
http://jcranky.com
http://lojinha.paulosiqueira.com.br
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/2Trf1L4tmVgJ.
But then I don't understand all the hype about googles closure templates..
public class Headers extends Action.Simple {
public Result call(Http.Context ctx) throws Throwable {
ctx.args.put("isPjax",((String[])ctx.request().headers().get("X-PJAX")) != null);
return delegate.call(ctx);
}
public static boolean isPjax() {
if (Http.Context.current() != null && Http.Context.current().args != null && Http.Context.current().args.get("isPjax") != null) {
return (Boolean) Http.Context.current().args.get("isPjax");
}
return false;
}
}
Then annotate your controllers...
@With(Headers.class)
@if(Headers.isPjax()) {
<title>@title</title>
@body
<script>console.log("pjax template loaded less data than full page load yay!");</script>
} else {
...Traditional full html...
}