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-unsubscr...@tapestry.apache.org
For additional commands, e-mail: dev-h...@tapestry.apache.org