abyrne85
abyrne85

Reputation: 1460

Prevent DOM elements from rendering on server side with angular universal

Is it possible to prevent elements from being rendered on the server when using angular universal? Specifically, I want to prevent ads from being rendered on the server as they are slowing down page load speed.

Upvotes: 2

Views: 276

Answers (1)

waterplea
waterplea

Reputation: 3661

You can use ngIf and test isPlatformBrowser with injected PLATFORM_ID.

Upvotes: 2

Related Questions