I have a model called gamer that contains a collection called games.
I am trying to make this collection optional, but I don't think Backbone has a way of doing that.
I tried just removing it, but that causes an error because I do need the collection sometimes, just not all the time.
I was wondering, is there a way or trick of making a collection optional inside a model?
Here is the model with the collection:
export default Backbone.Model.extend({
apUrl: '/api/gamerGroups',
initialize() {
this.games = new GroupAllowableCollection();
this.games.url = () => this.apUrl + '/' + this.id + '/games';
Thanks!