Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

model methods #83

Open
weepy opened this issue Jun 12, 2012 · 1 comment
Open

model methods #83

weepy opened this issue Jun 12, 2012 · 1 comment

Comments

@weepy
Copy link

weepy commented Jun 12, 2012

is it possible to have methods on a model ?

I thought also it might be useful to add binding such that if the return type is a function - then it is called before being used.

so we could have :

model : {
  first: 'John',
  second: 'Smith',
  fullName: function() {
    return this.first() + ' ' + this.second()
  }
}

does this fit into the framework ?

@phonovision
Copy link

Sometimes it is uesful to just get the function and not the result of the function, for example for some sort of state machine.

But you can explicity call the funtion like this: someObject.model.get('fullName')();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants