Primeng schedule with Angular2 webpack

倖福魔咒の 提交于 2019-12-10 15:56:41

问题


I'm going to use Primeng schedule (http://www.primefaces.org/primeng/#/schedule) within a project based on Angular2 webpack starter(https://github.com/AngularClass/angular2-webpack-starter).

Since Primeng schedule depends on fullcalendar.js which is a jQuery plugin, I try to load fullcalendar and jQuery through webpack. I follow example at here (https://github.com/cagataycivici/angular2-webpack-starter).

In package.json, I added settings below to "devDependencies"

"fullcalendar": "^2.7.2",
"jquery": "^2.2.4",
"jquery-ui": "^1.10.5",

and added settings below to vendor.js

import 'script!jquery/dist/jquery.min.js';
import 'script!moment/moment.js';
import 'script!fullcalendar/dist/fullcalendar.js';

But the problem is that the Primeng schedule is not rendered in the webpage, even though the <p-schedule></p-schedule> tag is actually there. Did I miss something?


回答1:


You need to modify the angular-cli.json, add these to the angular-cli.json file

"styles"           : [
                "../node_modules/fullcalendar/dist/fullcalendar.min.css",
                "../node_modules/primeng/resources/primeng.min.css",
                "../node_modules/primeng/resources/themes/omega/theme.css"
            ],
            "scripts"          : [
                "../node_modules/jquery/dist/jquery.js",
                "../node_modules/moment/min/moment.min.js",
                "../node_modules/fullcalendar/dist/fullcalendar.js"
            ],


来源:https://stackoverflow.com/questions/37447536/primeng-schedule-with-angular2-webpack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!