Skip to content

Instantly share code, notes, and snippets.

@iamssen
Created July 26, 2016 06:00
Show Gist options
  • Save iamssen/f159b364568b2a449c7e003b74329780 to your computer and use it in GitHub Desktop.
Save iamssen/f159b364568b2a449c7e003b74329780 to your computer and use it in GitHub Desktop.
@debugCycle() @component({...}) class AngularComponent { ... }
import {AfterViewChecked} from '@angular/core';
import {applyMixins} from 'rxjs/util/applyMixins';
class ElementDebugger implements AfterViewChecked {
ngAfterViewChecked() {
console.log(this);
}
}
export function debugCycle() {
return function (constructor:Function) {
applyMixins(constructor, [ElementDebugger]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment