I have web application written with Spine.js
. It has 2 language translations. I want to store current application's translation in Spine Model.
My model:
class Translation extends Spine.Model
@configure "Translation", "lang"
@getLang: ->
Translation.all()
module.exports = Translation
I have function which changes translation in application and i save new translation to the model in this function:
changeLang: (locale) ->
lang = Translation.create({lang: locale})
lang.save()
But when i try to fetch data from Translation
model from another controller i get empty result:
Translation = require("models/translation")
...
alert(Translation.getLang())
I got empty alert. How can i make it correctly?
Thank you.