1

在此处输入图像描述

上图是我添加 Angular 日历时的唯一显示。它与 Font Awesome 有冲突吗?因为我在我的 Angular 项目中安装了 Font Awesome,并以 Angular Material 作为其主要样式和组件框架。

HTML:

<mwl-calendar-month-view [viewDate]="viewDate" [events]="events">
</mwl-calendar-month-view>

TS:

import { Component } from '@angular/core';
import { CalendarEvent, CalendarUtils } from 'angular-calendar';

@Component({
    selector: 'app-creator-profile-calendar',
    templateUrl: './calendar.component.html',
    styleUrls: ['./calendar.component.scss'],
})
export class CalendarComponent {

    viewDate: Date = new Date();

    events: CalendarEvent[] = [];

}

模块:

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CalendarComponent } from './components/calendar/calendar.component';

import { CalendarModule, DateAdapter } from 'angular-calendar';
import * as moment from 'moment';
import { adapterFactory } from 'angular-calendar/date-adapters/moment';
export function momentAdapterFactory() {
    return adapterFactory(moment);
};

@NgModule({
    declarations: [
        CalendarComponent
    ],
    imports: [
        CommonModule,
        CalendarModule.forRoot({ provide: DateAdapter, useFactory: momentAdapterFactory })
    ], 
})
export class CreatorProfileModule { }
4

1 回答 1

1

哦好的。我忘了添加"./node_modules/angular-calendar/css/angular-calendar.css"angular.json

当您手动安装时,这解决了这个问题。

于 2020-01-09T02:00:24.247 回答