ie8预期标识符错误 - 角度

Pip*_*Man 3 javascript internet-explorer-8 angularjs

我的应用程序几乎在所有浏览器中运行,但是当我使用ie8预期标识符发生时.

 $scope.delete = function (index) {

        $scope.recipelists.splice(index, 1);

        localStorage.setItem('markedRecipes', JSON.stringify($scope.recipelists))

        if ($scope.recipelists == 0) {
            $modalInstance.dismiss('cancel');
        }
} 
Run Code Online (Sandbox Code Playgroud)

这是ie8的控制台在错误显示时指示我的地方.

我不知道这有什么问题.

谢谢!

Fel*_*ing 8

IE8不支持 保留字作为文字对象属性.使用

$scope['delete']
Run Code Online (Sandbox Code Playgroud)

代替.