When using auto-complete with ssr, the initialization of the service throw ERROR ReferenceError: document is not defined at NguiAutoCompleteDirective.ngOnInit
Steps to reproduce and a minimal demo
I canno't create a plunker since it's a ssr rendering problem.
But to reproduce the problem, you can just test to use the autocomplete module with universal.
Then directly from the server the component which use the autocomplete directive.
Current behavior
No rendering, only :
ERROR ReferenceError: document is not defined
at NguiAutoCompleteDirective.ngOnInit
Expected/desired behavior
No errors being throwed by not initializing the service server side.
Other information
I've opened the pull request #366, where i just check if we are on the browser before running anything in the service.
When using auto-complete with ssr, the initialization of the service throw ERROR ReferenceError: document is not defined at NguiAutoCompleteDirective.ngOnInit
Steps to reproduce and a minimal demo
I canno't create a plunker since it's a ssr rendering problem. But to reproduce the problem, you can just test to use the autocomplete module with universal. Then directly from the server the component which use the autocomplete directive.
Current behavior
No rendering, only : ERROR ReferenceError: document is not defined at NguiAutoCompleteDirective.ngOnInit
Expected/desired behavior
No errors being throwed by not initializing the service server side.
Other information
I've opened the pull request #366, where i just check if we are on the browser before running anything in the service.