Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 1
    Don't you need to inject PLATFORM_ID in the constructor and give this value as parameter in de isPlatformBrowser method? Commented Dec 18, 2017 at 10:41
  • 1
    @PierreDuc Yes, the answer is wrong. isPlatformBrowser is a function and will always be truthy. I've edited it now. Commented Jan 14, 2018 at 19:30
  • Thanks! It's correct now! Just verified the API: github.com/angular/angular/blob/… Commented Jan 15, 2018 at 2:52