我正在构建一个需要日历来查看事件的Angular应用程序,我使用PrimeNG版本7完整日历,我确实使用npm安装了primeNG和fullCalendar,如下所示:
npm install fullcalendar@4.0.0-alpha.2 --save
,然后在文档中应用FullCalendar的基本用法。
<p-fullCalendar [events]="events"></p-fullCalendar>
这是结果视图
日历未按预期显示。
这是我的package.json文件
{
"name": "sahabeh-driving",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "github:angular/animations-builds",
"@angular/cdk": "github:angular/cdk-builds",
"@angular/common": "^7.1.4",
"@angular/compiler": "^7.1.4",
"@angular/core": "^7.1.4",
"@angular/forms": "^7.1.4",
"@angular/http": "^7.1.4",
"@angular/platform-browser": "^7.1.4",
"@angular/platform-browser-dynamic": "^7.1.4",
"@angular/router": "^7.1.4",
"@ngx-translate/core": "^11.0.1",
"@ngx-translate/http-loader": "^4.0.0",
"chart.js": "^2.7.3",
"core-js": "^2.5.4",
"fullcalendar": "^4.0.0-alpha.2",
"primeng": "^7.0.3",
"rxjs": "^6.0.0",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular/compiler-cli": "^7.1.4",
"@angular-devkit/build-angular": "~0.6.5",
"typescript": "~3.1.6",
"@angular/cli": "~7.1.4",
"@angular/language-service": "^7.1.4",
"@types/jasmine": "~2.8.6",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.2.1",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~1.4.2",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.3.0",
"ts-node": "~5.0.1",
"tslint": "~5.9.1"
}
}
答案 0 :(得分:1)
似乎您还必须包括FullCalendar自己的CSS文件:
"styles": [
"node_modules/fullcalendar/dist/fullcalendar.min.css",
"node_modules/primeng/resources/themes/omega/theme.css",
"node_modules/primeicons/primeicons.css",
"node_modules/primeng/resources/primeng.min.css",
"src/styles.scss"
]