您的位置:首頁技術文章
文章詳情頁

angular.js - SpringMVC+Angular如何設計路由,從多個頁面不止index.html作為入口

瀏覽:166日期:2024-03-21 15:02:46

問題描述

SpringMVC+Angular做復雜的應用,一般都不是單頁應用,如果想要繼續使用Angularjs的話,應該如何設計路由呢?初次接觸,感覺很迷惑,求指教。

問題解答

回答1:

http://ued.taobao.org/blog/2014/04/xtpl/

回答2:

可以使用angularjs自己的路由模塊,如下:angular.module(’myApp’,[’ngRoute’]).config(’$routeProvider’, function($routeProvider){ $routeProvider.when('url',{ templateUrl: ’’, controller: ’’}).otherwise({ redirectTo : ’url’}) });如果這個不夠使的,可以學習一下ui-router:https://github.com/angular-ui/ui-router,這個功能強大一些。

回答3:

ANGULAR SPA + JERSEY + SPRINGMVC 整合應用 這篇講的很清楚

http://www.liaozhida.net/angular/angular-spa-jersey-springmvc-%E6%95%B4%E5%90%88%E5%BA%94%E7%94%A8.html

標簽: HTML
国产综合久久一区二区三区