Home  >  Q&A  >  body text

angular.js - SpringMVC+Angular如何设计路由,从多个页面不止index.html作为入口

SpringMVC+Angular做复杂的应用,一般都不是单页应用,如果想要继续使用Angularjs的话,应该如何设计路由呢?初次接触,感觉很迷惑,求指教。

PHP中文网PHP中文网2714 days ago800

reply all(3)I'll reply

  • 迷茫

    迷茫2017-05-15 16:51:18

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

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-15 16:51:18

    You can use angularjs’ own routing module, as follows:
    angular.module('myApp',['ngRoute']).config('$routeProvider',
    function($routeProvider){
    $routeProvider.when("url",{
    templateUrl: '',
    controller: ''
    }).otherwise({
    redirectTo : 'url'
    })
    }
    );
    If this is not enough, you can learn ui-router: https://github.com/angular-ui/ui-router, which is more powerful.

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-15 16:51:18

    ANGULAR SPA + JERSEY + SPRINGMVC integrated application This article explains it very clearly

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

    reply
    0
  • Cancelreply