我之前在向Angular实现FullCalendar时遇到了问题.我以为你们可能也想要更新.
如何正确实现Angular 5的fullcalendar而没有任何错误?我正在尝试将其实现为特定组件.我安装了以下软件包
仅供参考,以下帖子是我找到解决方案的最接近的帖子.我按照说明操作,但我仍然得到'JQueryPromise'错误.请提前通知并表示感谢!
的package.json
"fullcalendar": "^3.8.0",
"fullcalendar-scheduler": "^1.9.1",
"jquery": "^3.2.1",
"moment": "^2.20.1",
Run Code Online (Sandbox Code Playgroud)
.angular-cli.json
"styles": [
"styles.css",
"../node_modules/fullcalendar/dist/fullcalendar.min.css",
"../node_modules/fullcalendar-scheduler/dist/scheduler.min.css"
],
"scripts": [
"../node_modules/jquery/dist/jquery.min.js",
"../node_modules/moment/min/moment.min.js",
"../node_modules/fullcalendar/dist/fullcalendar.min.js",
"../node_modules/fullcalendar-scheduler/dist/scheduler.min.js"
],
Run Code Online (Sandbox Code Playgroud)
main.ts
import * as jQuery from "jquery";
(window as any).$ = (window as any).jQuery = jQuery;
Run Code Online (Sandbox Code Playgroud)
app.component.html
<div id='calendar'></div>
Run Code Online (Sandbox Code Playgroud)
app.component.ts
import { Component } from '@angular/core';
import 'fullcalendar';
import 'fullcalendar-scheduler';
declare let $: any;
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'] …Run Code Online (Sandbox Code Playgroud) 我正在尝试创建一个自定义@Select(),以便能够向下钻取特定树并动态返回值。获取未定义或未定义(正在执行)
user.component.ts
const location = 'new york'
@Select(state => UserState.getUserLocationSlots(state, location)) slots$;
Run Code Online (Sandbox Code Playgroud)
user.state.ts
@Selector()
static getUserLocationSlots(state: UserStateModel, location: any) {
console.log(state);
console.log(location); // <-- expecting 'new york', but getting undefined
}
Run Code Online (Sandbox Code Playgroud)