2017-04-11 63 views
1

我在新版本中執行tuto wakanda,當我播放js方法addSuperheroes.js時,出現錯誤代碼4055。 我需要幫助。wakanda remove()無法讀取屬性'刪除'未定義 - errCode 4055

方法:

ds.Superhero.remove(); 
new ds.Superhero({name:"Batman"}).save(); 
new ds.Superhero({name:"Superman"}).save(); 
var favoriteSuperhero = new ds.Superhero({name:"Wonder Woman"}); 
favoriteSuperhero.save(); 
ds.Superhero.all(); 

錯誤:

{ 
    "__ERROR": [ 
     { 
      "message": "Cannot read property 'remove' of undefined, line #1, file:///Users/arnaudthierard/Documents/Wakanda/solutions/HelloWorldWeb/back-end-superheroes/script/addSuperheroes.js.", 
      "componentSignature": "jvsc", 
      "errCode": 4055 
     }, 
     { 
      "message": "Error evaluating javascript file:///Users/arnaudthierard/Documents/Wakanda/solutions/HelloWorldWeb/back-end-superheroes/script/addSuperheroes.js", 
      "componentSignature": "JS4D", 
      "errCode": 2 
     } 
    ] 
} 
+1

你確定Superhero類是被定義的嗎?在運行代碼之前,您是否嘗試過重新加載解決方案/服務器? –

回答

1

確保在模型中的數據類被命名爲超級英雄(不超級英雄超級英雄。 ..)

+0

我有寫 「超級英雄」: 「類」:{ \t \t \t 「超級英雄」:{ \t \t \t \t 「panelColor」: 「#B7DDE8」, \t \t \t \t 「面板」:{ \t \t \t \t \t 「ISOPEN」: 「真」, \t \t \t \t \t 「pathVisible」:真實, \t \t \t \t \t 「位置」:{ \t \t \t \t \t \t 「X」:25, \t \t \t \t \t \t 「Y」:20 \t \t \t \t \t} \t \t \t \t} \t \t \t }, \t \t \t 「電影」:{ \t \t \t \t 「panelColor」: 「#E5B9B7」, \t \t \t \t 「面板」:{ \t \t \t \t \t 「ISOPEN」: 「真」, \t \t \t \t \t 「pathVisible」:真實, \t \t \t \t \t 「位置」:{ \t \t \t \t \t \t 「X」:349, \t \t \t \t \t \t 「Y」:21 \t \t \t \t \t} \t \t \t \t} \t \t \t} \t \t}, – Pratoux

+0

謝謝爲答案 – Pratoux

+0

任何人都可以幫助我? – Pratoux

相關問題