Jquery works on the browser side and browser functions is not supported on server side.
for example if you want to use jquery in angular universal you will have to make sure you are using it on browser side only.
For example you can do the following.
In your component.ts file import the following.
import { isPlatformServer } from '@angular/common';
import * as $ from 'jquery';
and then in your ngOnInit function do the following
constructor(@Inject(PLATFORM_ID) private platformId: any) {}
ngOnInit() {
if (isPlatformBrowser(this.platformId)) {
/* jQuery here */
$("#test-button").click(function () {
alert('WOOOW');
$(this).css("background","#000");
});
}
}