Angularjs 引导一个有角度的应用程序

Angularjs 引导一个有角度的应用程序,angularjs,angular-ui-router,Angularjs,Angular Ui Router,我正在使用别人编写的代码引导angular应用程序: window.app = angular.module('angularYoApp', ['ui.router',]); window.bootstrap = function(){ angular.bootstrap(document, ['angularYoApp']); }; window.init = function(){ window.bootstrap(); }; $(function(){ if

我正在使用别人编写的代码引导angular应用程序:

window.app = angular.module('angularYoApp', ['ui.router',]);

window.bootstrap = function(){
    angular.bootstrap(document, ['angularYoApp']);
};

window.init = function(){
    window.bootstrap();
};

$(function(){
    if (window.location.hash == "#_=_") window.location.hash = "";  // ...

    window.init();
});
我在配置中将html5Mode设置为true:

$locationProvider.html5Modetrue.hashPrefix'!'

一切正常,但我想知道,这条线是干什么用的:

如果window.location.hash==\u=\ window.location.hash=


这个评论并没有真正的帮助。我需要HTML5模式吗?

这是用于修复facebook重定向的,它似乎将这些字符附加到url中

html5=错误

if (window.location.hash === '#_=_') window.location.hash = '#!';
如果您正在使用

$locationProvider.hashPrefix('!');
在您的情况下,如果您将html5设置为true

  if (window.location.hash == "#_=_") window.location.hash = "";
我想你在html5中无论如何都需要它