()
| 31 | constructor(@Inject(PLATFORM_ID) private platformId: string) {} |
| 32 | |
| 33 | ngOnInit() { |
| 34 | if (isPlatformServer(this.platformId)) { |
| 35 | this.state.set('color', () => 'green'); |
| 36 | this.state.set('colors', () => ['green', 'purple']); |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | // Just a dummy method to ensure that the `unpatch` directive is instantiated w/o exceptions |
| 41 | // on the server side. |