Encountered an issue with a JavaScript code snippet within my angular project. It throws a syntax error in IE 11, but runs smoothly in Chrome. Interestingly, this particular function is not even called on the initial page load, yet the error persists.
Upon commenting out the problematic section, the page loads without any issues.
The error seems to be centered around the .then
line, which is confusing me as to why it's causing trouble.
$scope.showNewTeamDialog = function (ev) {
$mdDialog.show({
controller: NewTeamDialogController,
templateUrl: 'NewTeam.html',
locals: { newTeamName: $scope.newTeamName },
parent: angular.element(document.body),
targetEvent: ev
}).then((newTeamName) => {
if (newTeamName !== undefined) {
$scope.newTeamName = newTeamName.newTeamName;
$scope.createNewTeam();
}
});
};