Problems with jQuery and css in angular2


I am developing a web application in angular2 where it is formed by the following structure: a header, a drop-down side menu, the content of the app on the right side and a footer at the end.

My problem is how to make the height of the menu always reach the footer when the content of the page is very large and that when the content of the page is very small the footer remains at the bottom of the screen.

I've seen several examples of doing this with jQuery that work fine every time the page is reloaded or with the $(window).resize(function () {}) ; but as in angular its content changes without reloading the page they do not work for me.

I would like someone to show me an example of how to do this in angular2 . Greetings

asked by Richard Urquiza Santiesteban 28.09.2017 в 14:09

1 answer


First, do not join jQuery and Angular, or one or the other.

The second, try this and tell me.

<div (window:resize)="onResize($event)">


onResize(event) {;


@HostListener('window:resize', ['$event'])
onResize(event) {;

Assuming the global tragets are window , document , and body .


answered by 28.09.2017 в 14:15