Jos*_*ung 2 javascript json node.js angularjs
我为我的后端使用nodejs&expressjs,为我的前端使用Angular.在我的网站中使用Angular翻译时,控制台会显示以下消息:
Error: JSON Parse error: Property name must be a string literal
parse@[native code]
fromJson@http://localhost:3000/angular/angular.js:1321:19
defaultHttpResponseTransform@http://localhost:3000/angular/angular.js:10393:24
http://localhost:3000/angular/angular.js:10484:14
forEach@http://localhost:3000/angular/angular.js:322:24
transformData@http://localhost:3000/angular/angular.js:10483:10
transformResponse@http://localhost:3000/angular/angular.js:11278:34
processQueue@http://localhost:3000/angular/angular.js:15961:30
http://localhost:3000/angular/angular.js:15977:39
$eval@http://localhost:3000/angular/angular.js:17229:28
$digest@http://localhost:3000/angular/angular.js:17045:36
$apply@http://localhost:3000/angular/angular.js:17337:31
done@http://localhost:3000/angular/angular.js:11572:53
completeRequest@http://localhost:3000/angular/angular.js:11778:15
requestLoaded@http://localhost:3000/angular/angular.js:11711:24
Run Code Online (Sandbox Code Playgroud)
我确信引用了JSON文件中的所有属性.
这是语言环境文件:
{
"directives.language-select.Language": "Select Language",
"views.video-modal.Download": "Download",
"views.video-modal.Visit": "Visit",
"views.video-modal.Copy": "Copy",
"views.video-modal.Close": "Close",
}
Run Code Online (Sandbox Code Playgroud)
奇怪的是,当我只有
"directives.language-select.Language": "Select Language",
Run Code Online (Sandbox Code Playgroud)
这条线.该网站运作良好.是什么导致这个问题?