Есть ли способ сделать функцию частной в магистрали, так что она будет доступна только самой модели и также иметь доступ к this
?
Как сделать updateTime
приватным?
var Timeline = Backbone.Model.extend({
url: 'servertime/',
start: function(){
this.fetch({
success: function(timeline, response){
timeline.updateTime();
setInterval(function() {
timeline.updateTime();
}, 60 * 1000);
}
});
},
updateTime: function(){ //How can I make this private?
this.time = ...
}
});