- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试安装此日历库 ( https://www.npmjs.com/package/angular2-fullcalendar ),但按照以下步骤操作,出现以下错误:
ERROR in node_modules/angular2-fullcalendar/node_modules/@angular/core/src/facade/async.d.ts(8,10): error TS2305: Module '"<...>/node_modules/rxjs/Subject"' has no exported member 'Subject'.
node_modules/angular2-fullcalendar/node_modules/@angular/core/src/facade/async.d.ts(9,10): error TS2305: Module '"<...>/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/angular2-fullcalendar/node_modules/@angular/core/src/facade/async.d.ts(10,10): error TS2305: Module '"<...>/node_modules/rxjs/Subject"' has no exported member 'Subject'.
node_modules/angular2-fullcalendar/node_modules/@angular/core/src/util/lang.d.ts(8,10): error TS2305: Module '"<...>/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/rxjs/Observable.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Observable'.
node_modules/rxjs/Subject.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Subject'.
Uncaught Error: Can't construct a query for the property "myCalendar" of "HomeComponent" since the query selector wasn't defined.
import { Component, OnInit } from '@angular/core';
import { PageEvent } from '@angular/material';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.css']
})
export class HomeComponent implements OnInit {
// MatPaginator Inputs
length = 100;
pageSize = 10;
pageSizeOptions: number[] = [5, 10, 25, 100];
// MatPaginator Output
pageEvent: PageEvent;
constructor() { }
ngOnInit() {
}
setPageSizeOptions(setPageSizeOptionsInput: string) {
this.pageSizeOptions = setPageSizeOptionsInput.split(',').map(str => +str);
}
calendarOptions:Object = {
height: 'parent',
fixedWeekCount : false,
defaultDate: '2016-09-12',
editable: true,
eventLimit: true, // allow "more" link when too many events
events: [
{
title: 'All Day Event',
start: '2016-09-01'
},
{
title: 'Long Event',
start: '2016-09-07',
end: '2016-09-10'
},
{
id: 999,
title: 'Repeating Event',
start: '2016-09-09T16:00:00'
},
{
id: 999,
title: 'Repeating Event',
start: '2016-09-16T16:00:00'
},
{
title: 'Conference',
start: '2016-09-11',
end: '2016-09-13'
},
{
title: 'Meeting',
start: '2016-09-12T10:30:00',
end: '2016-09-12T12:30:00'
},
{
title: 'Lunch',
start: '2016-09-12T12:00:00'
},
{
title: 'Meeting',
start: '2016-09-12T14:30:00'
},
{
title: 'Happy Hour',
start: '2016-09-12T17:30:00'
},
{
title: 'Dinner',
start: '2016-09-12T20:00:00'
},
{
title: 'Birthday Party',
start: '2016-09-13T07:00:00'
},
{
title: 'Click for Google',
url: 'http://google.com/',
start: '2016-09-28'
}
]
};
}
<angular2-fullcalendar [options]="calendarOptions"></angular2-fullcalendar>
@import "fullcalendar/dist/fullcalendar.min.css";
"angular2-fullcalendar": "^1.0.19",
"ap-angular2-fullcalendar": "^1.6.4",
最佳答案
这是因为 Angular 6 正在使用 RxJS v6 .您尝试使用的日历包非常过时,并且正在使用目录不同的旧版本的 RxJS。
你可以试试npm install rxjs@6 rxjs-compat@6 --save
在产品目录中,它基本上会为尚未更新到 RxJS 的依赖项安装一个兼容层v6 .
希望这可以帮助。
More Info
就您评论中的错误而言,这是我安装/使用此软件包的方式。
在项目目录中:
npm i ap-angular2-fullcalendar jquery --save
npm i --save-dev @types/jquery@3.2.7
import * as $ from 'jquery'
import {CalendarComponent} from "ap-angular2-fullcalendar/src/calendar/calendar";
...
declarations: [CalendarComponent],
calendarOptions:Object = {
height: '600px',
...
}
关于Angular - 安装库 fullcalendar 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51698896/
有没有办法在 FullCalendar 中动态更改事件模板? 更新。 我想要的是指定新的事件 html(例如在 eventRender 回调中)并使 FullCalendar 将其用于我的事件渲染。像
我正在使用 FullCalendar 组件,我需要为周末、周五和周六着色。 我已经按照这里的建议使用了以下内容: Can I set a different color for the weekend
我正在实现 fullcalendar 并在时区问题上苦苦挣扎。 这是代码: $('#calendar').fullCalendar({ //re-initialize the calendar
我希望 fullCalendar 在不重新加载页面的情况下重绘自身(所有结构和事件)。 场景: 我正在使用支持 Resource View 的 fullCalendar 补丁。 .对于一些用户操作,我
我想在同一页面上添加多个 FullCalendars(可选)以安排不同类型的事件并将信息保存在数据库中,但查看演示/示例代码,我似乎每页只能添加一个日历,因为它由 呈现。 .您能否让我知道是否有办法
我已将 FullCalendar 设置为接受 drop,确实如此。但是我用 revert:'invalid' 构造的可拖动对象似乎无法将 FullCalendar 上的日期识别为可放置的,并恢复回来。
我公司最近购买了 Full-Calendar Scheduler 插件。有没有正确的方法在代码中隐藏许可证 key ?对此有哪些好的做法? 最佳答案 你是对的,没有办法完全隐藏 schedulerLi
在 FullCalendar如何使资源可点击? 我已经检查了 API,但我看不到任何相关内容,我是否遗漏了什么? 我在找 resource-click -事件就像我们对事件一样? 最佳答案 在 res
我有额外的数据(在我的例子中是一个数字),它是通过一个 javascript 函数获得的——我想在每天的单元格中显示它。 例如 - 如果天数在右上角,我希望它显示在左上角 - 每天自动显示。 我看到有
我在单个页面上创建多个 fullcalendar,我想编写一个事件渲染回调,以便它可以从调用它的 fullcalendar 实例中读取选项,例如 minTime 和 maxTime,不知道如何做这个。
看起来默认值为 20 像素,但我希望将其提高,因此长度为 1 个时隙的事件将能够显示事件标题和正文。当前,当事件长度为 1 个时隙时,仅显示事件标题。 最佳答案 任何仍在寻找新版本答案的人。 在新版本
我正在尝试实现 this solution在 Fullcalendar 中“变灰”过去的事件,但我没有任何运气。不过,我不太精通 Javascript,所以我认为我犯了一些愚蠢的错误。 我已经将建议的
我使用 jQuery fullCalendar (http://arshaw.com/fullcalendar/docs/selection/unselectAuto/) 我使用这个日历的可选版本 (
这看起来非常简单,但我花了半天时间把头撞在墙上,试图弄清楚为什么我的全日历事件只显示在 77 像素,而单元格(月 View )的宽度似乎是 90 像素或更高。我曾尝试修改 fc-event css 规
我正在尝试在全日历中将时间格式更改为 24 小时制。 我试图找到它 here但我无法弄清楚。 这里的代码片段: jQuery('#calendar').fullCalendar({ heade
在月 View 中 fullcalendar 有一个很好的功能,可以在非全天事件的顶行显示开始时间。如果您不想在事件标题中提供更多详细信息,这可能很有用。 我想在月 View 中显示几个详细信息,例如
如何在 fullcalendar 中显示事件的描述? 我有具有标题和描述的事件。 那么如何显示描述呢? 最佳答案 当您添加标题和描述时,它将连接起来。 使用以下代码,您可以连接标题: eventRen
我正在尝试使用 FullCalendar 在网页上呈现 Google 日历中的事件。我想要开始日期/时间、描述和地点。 future 事件在一个 div 中,过去事件在另一个 div 中。 现在,我的
我正在尝试突出显示 FullCalender.io 中的选定日期(与当前日期类似)。 已关注 FullCalendar - Highlight a particular day in week vie
我是 FullCalendar 新手。在我的项目中,我需要显示带有时间范围的日历以及每天为每个培训中心分配的参与者。更准确地说,一天可以有很多个培训时段,由培训中心进行。因此,我想展示哪个培训中心分配
我是一名优秀的程序员,十分优秀!