Skip to content

Commit

Permalink
docs: fix some errors in ssr (#8506)
Browse files Browse the repository at this point in the history
  • Loading branch information
Laffery committed Apr 19, 2024
1 parent 742f14a commit b52ad50
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
4 changes: 2 additions & 2 deletions components/form/demo/register.ts
Expand Up @@ -136,11 +136,11 @@ import { NzFormTooltipIcon } from 'ng-zorro-antd/form';
max-width: 600px;
}
.phone-select {
.ant-select.ant-select-in-form-item.phone-select {
width: 70px;
}
.register-are {
.register-area {
margin-bottom: 8px;
}
`
Expand Down
25 changes: 20 additions & 5 deletions components/icon/page/index.ts
Expand Up @@ -3,8 +3,18 @@
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { DOCUMENT } from '@angular/common';
import { Component, Inject, Input, OnDestroy, OnInit, TemplateRef, ViewChild, ViewContainerRef } from '@angular/core';
import { DOCUMENT, isPlatformBrowser } from '@angular/common';
import {
Component,
Inject,
Input,
OnDestroy,
OnInit,
PLATFORM_ID,
TemplateRef,
ViewChild,
ViewContainerRef
} from '@angular/core';
import { of, Subscription } from 'rxjs';

import { manifest, ThemeType } from '@ant-design/icons-angular';
Expand Down Expand Up @@ -661,8 +671,10 @@ export class NzPageDemoIconComponent implements OnInit, OnDestroy {
}

constructor(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
/* eslint-disable @typescript-eslint/no-explicit-any */
@Inject(DOCUMENT) private dom: any,
@Inject(PLATFORM_ID) private platformId: any,
/* eslint-enable @typescript-eslint/no-explicit-any */
private _iconService: NzIconService,
private message: NzMessageService,
private viewContainerRef: ViewContainerRef
Expand All @@ -673,8 +685,11 @@ export class NzPageDemoIconComponent implements OnInit, OnDestroy {

ngOnInit(): void {
this.setIconsShouldBeDisplayed('outline');
this.loadModel();
this.popoverVisible = !localStorage.getItem('disableIconTip');
// load model in browser
if (isPlatformBrowser(this.platformId)) {
this.loadModel();
this.popoverVisible = !localStorage.getItem('disableIconTip');
}
}

ngOnDestroy(): void {
Expand Down

0 comments on commit b52ad50

Please sign in to comment.