tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Andreou <andre...@gmail.com>
Subject Re: Tapestry 5.4, AngularJS and partial page content
Date Fri, 08 Nov 2013 03:17:26 GMT
I'm curious - why do you want to use tapestry's component mechanism to
provide the angular templates?

Wouldn't they be loaded only once during the lifecycle of the angular app?
Wouldn't you then want to bundle
them in a single file and skip the extra template requests?




On Thu, Nov 7, 2013 at 5:46 PM, Michael Wyraz <michael.wyraz@evermind.de>wrote:

> Hello,
>
> I'm implementing a proof-of-concept application with tapestry 5.4 and
> angularjs. All basic things work, now I try to find some best practice.
>
> Angularjs provides the opportinity to dynamically load content (called
> 'view templates') into a page area and connect it with logic. This allows
> to split up a large application into parts - a concept very similar to
> tapestry's components. One can embed templates within the page (surrounded
> by a special script tag) or can load it from the server.
>
> Angularjs behaves in the following way to load "mytemplate":
> - check if there's a script tag <script type="text/ng-template"
> id="mytemplate"> - if yes take the script's content as template
> - otherwise load "mytemplate" from the server relative to the page's url
>
> Now I want to use tapestry's component mechanism to provide such templates:
>
> 1. I could simply put all into one page and put the template's content
> into tapestry components:
> <script type="text/ng-template" id="mytemplate">
>   <t:mytemplate/>
> </script>
> This is simple but results in a (very big) page
>
> 2. I could create a page for each template.
> This would make angular to load the template on demand.
> Problem here is that tapestry will not allow to create "partial pages"
> starting with a <div>.
>
> 3. Tweak angularjs to use some zone update mechanism to load the templates.
> I have no idea if/how this is possible. If someone already did such,
> please let me know.
>
> What do you think would the best way to do it?
>
> Regards,
> Michael.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>


-- 
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Apache Tapestry PMC / http://chesstu.be owner
Open Source / JEE Consulting

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message