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

Managing a component's life cycle

As we said earlier, Aurelia provides very complete life cycle event methods to customize and improve the behavior of our application. Here's a list with these methods:

export class ComponentLifecycleExample {  retrievedData;  constructor(service) {    // Create and initialize your class object here...    this.service = service;  }  created(owningView, myView) {    // Invoked once the component is created...  }  bind(bindingContext, overrideContext) {    // Invoked once the databinding is activated...  }  attached(argument) {    // Invoked once the component is attached to the DOM...    this.retrievedData = this.service.getData();  }  detached(argument) {    // Invoked when component is detached from the dom    this.retrievedData = null;

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