Today I came up against an issue with IE 11 and AngularJS that I am hoping someone has seen before.
I am bootstrapping my angular app and searching for an id element set as a placeholder in a modal and the loading a template view into ng-view depending on the app state. In Chrome and IE 10 this works fine. However, in IE 11 this doesn't. The error I am given is
Unable to get property 'reloadAndChooseView' of undefined or null reference
The undefined or null should be the scope found when calling
function chooseView(angular) {
var scope = angular.element('#edit-listing-page').scope();
scope.reloadAndChooseView();
}
once the app is bootstrapped I call chooseView which looks through the dom to find the element id and pulls the scope which is where the reloadAndChooseView() function is called. this just selects a route and loads the template into ng-view.
below is the function used to bootstrap my app
var boostrap = function (angular) {
angular.element(document).ready(function () {
angular.bootstrap(document.getElementById("edit-listing-page"), ['app']);
});
};
As mentioned above this is not an issue in Chrome, IE10 or Firefox. This only seems to be an issue with IE 11.
I have tried setting the X-UA-Compatible to IE 10, 9 and 8 compatibility mode to see if this rectifies this issue, but this did not help at all.
Does anyone have a suggestions