错误名称:Uncaught SyntaxError: Unexpected identifier
控制台输出:
1.谷歌:Uncaught SyntaxError: Unexpected identifier
2.火狐:SyntaxError: missing ] after element list
3.IE and Edge:SCRIPT1007: 缺少 ']'
错误代码:
setTimeout($rootScope.$broadcast(XXXXX,'xxxxx'), 1000);
错误原因:
setTimeout的参数,不支持AngularJS的$rootScope.$broadcast.
解决办法:
setTimeout(broadCast(xxxxx), 1000); var broadCast = function (xxxxx) { $rootScope.$broadcast(XXXXX, 'xxxxx'); }
用方法包装一下就好了。