Advantages/Disadvantages of HTML5 mode vs Hash mode AngularJS

后端 未结 2 1508
梦谈多话
梦谈多话 2021-01-04 02:17

With AngularJS 1.3, the tag is required when in HTML5 mode and that got me thinking about what are the advantages/disadvantages of HTML5 mode vs Ha

2条回答
  •  -上瘾入骨i
    2021-01-04 02:56

    Using HTML5 mode requires URL rewriting on server side, basically you have to rewrite all your links to entry point of your application (e.g. index.html). Requiring a tag is also important for this case, as it allows AngularJS to differentiate between the part of the url that is the application base and the path that should be handled by the application.

    For more information, see

    • AngularJS Developer Guide - Using $location HTML5 mode Server Side
    • AngularJS routing without the hash '#'
    • How to: Configure your server to work with html5Mode

提交回复
热议问题