Jul 28, 2017 · 1 min read
Hello Benajamin,
I have a doubt while writing the instance methods on a model. Lets assume there is a `user model` and a user have the option to create todo’s. Now a user can have many todo’s. How to write a function in the user models that returns the number of todo’s a user has. Example
instanceMethods: {
countTodos: function() {
// returns total number of todos of a user.
}
}