@banana6boom/ngx-ssr-platform
Version:
Add 14+ Angular support
39 lines (30 loc) • 870 B
Markdown
# /ngx-ssr-platform
Add 14+ Angular support
_Fork of [-ssr/platform](https://www.npmjs.com/package/@ngx-ssr/platform)_
Install package
```bash
npm i /ngx-ssr-platform
```
To determine the platform, use the tokens `IS_SERVER_PLATFORM` and `IS_BROWSER_PLATFORM`
```ts
export class SomeDirective {
constructor( isServer: boolean) {
if (isServer) {
viewContainer.createEmbeddedView(templateRef);
}
}
}
```
Use the `ifIsServer` and ` ifIsBrowser` structural directives in your template for rendering contents depending on the
platform:
```ts
export class AppComponent {}
```