import { Directive , Host , SkipSelf , ElementRef , Renderer } from 'angular2/core' ; @ Directive ( { selector : '[fix-scrolling]' , host : { '(window:resize)' : 'onResize($event)' } } ) export class FixScrolling { constructor ( private el , private renderer ) { this . setHeight ( ) ; } onResize ( event ) { this . setHeight ( ) ; } private setHeight ( ) { let height = '100' ; this . renderer . setElementStyle ( this . el . nativeElement , 'height' , `${ height }%` ) ; } }