Reputation: 32806
In the doc https://angular.io/guide/universal#app-server-module
I can read
providers: [
// Add universal-only providers here
],
so what are universal-only providers ?
Can you give me an example, please?
Upvotes: 1
Views: 471
Reputation: 3095
Its Server module specific services like
providers: [
{provide: 'WindowToken', useValue: null},
ServerSessionCache,
ServerSessionStorage
]
where WindowToken is used for window object, because i want to use window
object on browser module, so in case of browser module
browser module
providers: [
{provide: 'WindowToken', useValue: window}
....
]
but in server module i dont want to use window object
providers: [
{provide: 'WindowToken', useValue: null}
....
]
Upvotes: 1