AngularJS routing vs backend routing

前端 未结 2 1223
南旧
南旧 2021-02-02 17:56

I would like to use AngularJS in my next project. The application with Python backend and html5, Angular frontend.

I am going to use MVC framework on backend and I am li

2条回答
  •  梦谈多话
    2021-02-02 18:15

    You can choose to do either client-side routing, server-side routing or a combination of both...

    In case of client-side routing, you would have a single page served by the server. All routing after that would be done by the client. If you have an application with a lot of pages, this might not be the optimal solution and you might want to do server-side routing.

    In case of server-side routing, you would serve a page for every route defined on the server application. Each of them would contain a mini-angularJS application (furthermore, each of these mini-SPAs could do some additional routing if that makes sense)

    It's up to you to decide what works best for your case.

    Update:

    Definitely check out UI-router from the AngularUI project if you are planning to do client-side routing. It gives you the ability to create state-based views and some other things that were not possible with Angular's native routing.

提交回复
热议问题