I use Spring MVC and AngularJS for my project. Can AngularJs $routing and ngView be used instead of or together with the Apache Tiles framework? As far as I can see using $routing and ngView we create templates and reuse them in a singlePage application.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Is there a limit to how many levels you can nest i
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- How to toggle on Order in ReactJS
Yes, AngularJs' routing can be use instead of tiles. Also you can use together, but after it may broke singlepage app idea.
In tiles you probably use jsp files. So jsp files compiling in server-side , and serving as html file in client side via browser.
In angular also you can create base layout. And like tiles' layout
extend
ability , withng-include
you can include your other views yourng-view
htmls. And when route another page ng-view will refresh included area(Also there are some third party plugins/frameworks on AngularJs about it.Take a look ui-router. It provides nice nested views.).In Angular way
commonly
no need to get html from serverside(this situation may change depending on the other situations. To make singlepage no need.). So you will need to convert your controllers which returnsModelAndView
object to Map(as an example) to returnjson
. At this time routing will be achieved by angularJs' routes. After these refactorings , you will have a singlepage application. Or you can makehybrid-singlepage
(some pages have too many event so you van start with that pages to make single page to reduce workload) So It will reveal workload depends on your application's size.