AngularJS with Apache Tiles

允我心安 提交于 2019-12-03 21:16:51

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 , with ng-include you can include your other views your ng-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 returns ModelAndView object to Map(as an example) to return json. At this time routing will be achieved by angularJs' routes. After these refactorings , you will have a singlepage application. Or you can make hybrid-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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!