Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : A couple of questions about Observes

$
0
0
It's a plugin. 

You can create a fullName as a function on the prototype like

fullName: fn(){
  return this.attr('first')+this.attr('last')
}



If fullName called in a template, it will automatically be live bound 

{{person.fullName}}

If you want fullName as a compute that you can pass around:

fN = can.compute(person.fullName, person)

fN() //-> "Justin Meyer"

You might be able to do that like

person.compute("fullName")

Sent from my iPhone

On Apr 18, 2013, at 12:45 PM, JavaScriptMVC Forum <noreply@zohodiscussions.com> wrote:


Viewing all articles
Browse latest Browse all 3491

Trending Articles