2016-08-24 80 views
1

我有一個環回模型,我不想堅持數據庫。它看起來(幾乎)像這樣:如何在環回中創建非持久模型

{ 
    "name": "Contact", 
    "base": "Model", 
    "properties": { 
     "name": { 
      "type": "string" 
     }, 
     "email": { 
      "type": "string" 
     } 
    } 
} 

現在,我該如何實例化這樣一個模型?我能做些什麼:

var contact = new app.models.Contact() 

如果可以,這是正確的方法嗎?非常感謝幫助。

安德烈斯

+0

那豈不是更容易只是嘗試,如果你能,而不是請求SO? –

回答

0

是的,它是建立一個模型實例的正確方法。

如果你想堅持,你可以使用:contact.save()