Angular前端语法错误 [英] Angular frontend syntax error
问题描述
启动棱角前端时,出现以下语法错误
When I start my angular frontend I get the following syntax error
choose.html:1未捕获的SyntaxError:JSON中的意外令牌l位于位置1
在JSON.parse()
在Object.fromJson(vendor.js:14110)
在Object.getObject(vendor.js:4234)
在Object.get(vendor.js:4347)
在Object.get(vendor.js:47560)
在runTranslate(vendor.js:47789)
在Object.invoke(vendor.js:17454)
在vendor.js:17262
在forEach(vendor.js:13111)
在createInjector(vendor.js:17262)
choose.html:1 Uncaught SyntaxError: Unexpected token l in JSON at position 1
at JSON.parse ()
at Object.fromJson (vendor.js:14110)
at Object.getObject (vendor.js:4234)
at Object.get (vendor.js:4347)
at Object.get (vendor.js:47560)
at runTranslate (vendor.js:47789)
at Object.invoke (vendor.js:17454)
at vendor.js:17262
at forEach (vendor.js:13111)
at createInjector (vendor.js:17262)
vendor.js是自动创建的,当我查找错误时,它实际上是特定于人们编写的内容,而不是自动生成的内容.我需要朝哪个方向的任何想法:
The vendor.js is automatically created and when I look up the error it is really specific to what people wrote and not something auto generated. Any idea in which direction I need to look:
在14110是以下段:
At 14110 is the following segment:
/**
* @ngdoc function
* @name angular.fromJson
* @module ng
* @kind function
*
* @description
* Deserializes a JSON string.
*
* @param {string} json JSON string to deserialize.
* @returns {Object|Array|string|number} Deserialized JSON string.
*/
function fromJson(json) {
return isString(json)
? JSON.parse(json)
: json;
}
推荐答案
我确实无法确认它,但这不是真正的解决方案,而是行
I have not really been able to confirm it and it is not a real solution but the line
在runTranslate(vendor.js:47789)
at runTranslate (vendor.js:47789)
让我相信我的翻译应用程序有问题.因为我不需要它,所以将其从应用程序中删除,它确实解决了我的问题.当然,这不是真正的解决办法,但对我来说已经足够了.
led me to believe there was a fault in my translate app. Because I did not need it I removed it from my application and it indeed solved my problems. This of course is not a true fix but it was enough for me.
这篇关于Angular前端语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!