Skip to content

Instantly share code, notes, and snippets.

@hetdev
Created August 27, 2019 16:39
Show Gist options
  • Save hetdev/e4e63cb63ea8253dd96f8b83e82a53e1 to your computer and use it in GitHub Desktop.
Save hetdev/e4e63cb63ea8253dd96f8b83e82a53e1 to your computer and use it in GitHub Desktop.
import {Component, Input, OnChanges, OnInit, SimpleChange} from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit, OnChanges {
title = 'phoenix-wc-wiki-ngx-lt';
@Input() token: string;
constructor() {
console.log('token constructor=' + this.token);
}
ngOnInit() {
console.log('token ngOnInit=' + this.token);
}
ngOnChanges(changes: {[token: string]: SimpleChange}) {
// check the object "changes" for new data
console.log('token ngOnChanges=' + this.token);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment