Reputation: 309
We are migrating from developing in Java with JSP to an AngularJS approach (rich-client).
In JSP we could template with Apache Tiles, so we defined common things, like menus, header and footer and import everywhere.
I was thinking in make it with JSP/Apache Tiles, but I think this will difficult my automated tests with Karma.
EDIT: We are building an huge application, we will have tons of forms/menu items, and we are planning to have one Single Page Application for each one of these.
Upvotes: 1
Views: 1988
Reputation: 614
Angularjs is the best solution for single -page application with thick-client. It goes well with everything and anything. Make sure you spend some time on designing your directives. These veidos might be helful: http://egghead.io/
And its not just directives. As a whole fraework its awesome. You can realy scale you application with best performance and testing support.
Upvotes: 0
Reputation: 353
It depends.
You can still use server-side templating (I use twig with a Symfony2 app) for the overall application and then use directives with partial templates (simple html files) for certain reoccuring elements that need to have functionality in some way.
You can actually write those partial templates in your favored template engine again, as long as ou make sure it will be parsed before it's delivered to the client.
Other then that: Just use simple HTML/CSS, use binding for "variables" and just use ANgular directives (ng-class, ng-if etc.) to style/display elements the way you want them based on your model data. And if you need more complex stuff: Just write your own directives!
Upvotes: 2
Reputation: 28750
Look into angular directives: http://docs.angularjs.org/guide/directive
Having a directive means you can define something like this:
<div class="someContainer">
<div class="menu"></div>
</div>
And have it turn into this:
<div class="someContainer">
<ul>
<li>Menu Item 1</li>
<li>Menu Item 2</li>
<li>Menu Item 3</li>
</ul>
</div>
Upvotes: 0