PrimeNG 日历不会显示弹出窗口

PrimeNG calendar won't show popup

我试图打开带有 PrimeNG 标签的日历,但每次我点击标签都不会打开日历,这里是我的代码: 从 'primeng/calendar';

导入 {CalendarModule}
@NgModule({
  declarations: [
    AppComponent,
    StoreMenuComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    ButtonModule,
    InputTextModule,
    FormsModule,
    InputNumberModule,
    CalendarModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

component.ts

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
      myDate1!: Date;
myEvent(evt: any) 
{
console.warn(evt)
}
}

component.html

 </div>
                    <div class="field col-12 md:col-4">
                        <label for="icon">Icon</label>
                        <p-calendar [(ngModel)]="myDate1" [showIcon]="true" inputId="icon"></p-calendar>
                    </div>

所有其他 primeNG 组件都在工作我对此有疑问,谢谢谁会回答我

最后我通过添加解决了:

import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

在模块中