Created
February 27, 2018 01:58
-
-
Save jorgeucano/9fcea2d75060e8f4d813d4ee018effac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit, OnDestroy } from '@angular/core'; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html', | |
styleUrls: ['./app.component.css'] | |
}) | |
export class AppComponent implements OnInit, OnDestroy { | |
title = 'app works!'; | |
constructor() { | |
console.log('soy un constructor'); | |
} | |
ngOnInit() { | |
console.log('esto se ejecuta en el momento que arranca a dibujarse el componente'); | |
} | |
ngOnDestroy() { | |
console.log('esto se ejecuta en el momento antes de que se destruya el componente y se cargue otro'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment