0

I've cloned, installed a fresh version of the MEAN stack from https://github.com/linnovate/mean, and then ran with grunt.

I've noticed that my root page is appending a /#!/ url segment to the end, and all my pages look something like:

http://localhost:3000/#!/
http://localhost:3000/#!/articles/
...

Any hints on how to get rid of that /#!/url segment? I can't tell if this is a Node/Angular/Express setting.

4

1 回答 1

0

这是在 Angular.js 中,它在 github 上的文件中注释了它为什么存在

https://github.com/linnovate/mean/blob/master/public/js/init.js

'use strict';
 angular.element(document).ready(function() {    
//Fixing facebook bug with redirect   
   if (window.location.hash === '#_=_') window.location.hash = '#!';    //Then init the app        angular.bootstrap(document, ['mean']);
 });

虽然我不声称理解为什么没有它会导致问题,而且我不确定它为什么会出现在每一页上?

于 2014-02-13T13:14:34.950 回答