[question] Different providers on client and server #1325

Closed
opened 2025-08-09 17:19:42 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @piotrek-k on 10/10/2016

Sorry that I'm creating issue to ask this question, but I don't know where else could I ask about it.
I've generated Angular app using your Yeoman generator. I want to use localStorage in my app, but it's inaccessible during server pre-rendering (there is nothing like localStorage in node or whatever renders this page).

I've found possible solution: http://stackoverflow.com/a/39098748/1804027 but it requires specifying different provider for client and different provider on server. How can I do that in your template, when I have one app.module.ts file for both client and server?

*Originally created by @piotrek-k on 10/10/2016* Sorry that I'm creating issue to ask this question, but I don't know where else could I ask about it. I've generated Angular app using your Yeoman generator. I want to use localStorage in my app, but it's inaccessible during server pre-rendering (there is nothing like localStorage in node or whatever renders this page). I've found possible solution: http://stackoverflow.com/a/39098748/1804027 but it requires specifying different provider for client and different provider on server. How can I do that in your template, when I have one `app.module.ts` file for both client and server?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1325
No description provided.