Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Aurelia code quality - part 3
import {inject} from 'aurelia-framework';
import {GreeterService} from './services/greeter-service.js';
@inject(GreeterService)
export class Greeter{
constructor(greeterService){
this.greeterService = greeterService;
}
attached(){ //called when the greeter component is attached to the DOM
this.greetings = this.greeterService.loadGreetings();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment