O'Reilly logo

Hands-On Full Stack Web Development with Aurelia by Erikson Haziz Murrugarra Sifuentes, Diego Jose Arguelles Rojas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Binding computed properties

Sometimes it is desirable to return a dynamically computed value (post-processed value) when accessing a property, or you may want to reflect the status of an internal variable without requiring the use of explicit method calls. In JavaScript, this can be accomplished with the use of a getter function:

export class Developer {  firstName = 'Erikson';  lastName = 'Murrugarra';  get fullName() {    return `${this.firstName} ${this.lastName}`;  }}

There's no trick here, you just need to bind the fullName property. The binding system will analyze the property and how we are referring to a function; it will process the required info before rendering the computed value. This is also called dirty checking; it will be constantly ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required