4

I have an web page that has two AngularJS apps on it. Because there are two apps, I have to bootstrap the apps onto the page. I'm bootstrapping the apps like this:

// Bootstrap the first app
var app1 = angular.module('app-1', []);
app1.controller('App1Controller', ['$scope', '$window', function ($scope, $window) {
}]);
angular.bootstrap($('#app1'), ['app-1']);

// Bootstrap the second app
angular.bootstrap($('#app-2'), ['my-app-name']);

My question is, how do I turn off hashbangs altogether? I am not using AngularJS for view management. I am using it for other things. For some reason though, when I visit a page with IE8 with Angular, the user gets redirected to a page with a hashbang in it. The hashbang causes a server-side error. For that reason, I NEED to turn that off. How do I do that?

JQuery Mobile
  • 6,221
  • 24
  • 81
  • 134

1 Answers1

5

You can turn on the angular html5 push state, which should scrub any hash bangs:

app1.config(['$locationProvider', function($locationProvider) {
     $locationProvider.html5Mode(true);
}]);
Alex Curtis
  • 5,659
  • 3
  • 28
  • 31