使用Angular2 webpack进行Primeng计划

时间:2016-05-25 21:01:17

标签: jquery fullcalendar webpack primeng

我将在基于Angular2 webpack starter(http://www.primefaces.org/primeng/#/schedule)的项目中使用Primeng计划(https://github.com/AngularClass/angular2-webpack-starter)。

由于Primeng计划依赖于df <- read.table(text="datetime,usage,available 2016-05-25 10:00:59.000000,12,96 2016-05-25 09:00:59.000000,8,96 2016-05-25 08:00:59.000000,0,96 2016-05-25 07:00:59.000000,0,96 2016-05-25 06:00:59.000000,0,96 2016-05-25 05:00:59.000000,0,96 2016-05-25 04:00:59.000000,0,96 2016-05-25 03:00:59.000000,0,96 2016-05-25 02:00:59.000000,0,96 2016-05-25 01:00:59.000000,0,96 2016-05-25 00:00:59.000000,0,96 2016-05-24 23:00:59.000000,0,96 2016-05-24 22:00:59.000000,0,96 2016-05-24 21:00:59.000000,0,96 2016-05-24 20:00:59.000000,2,96 2016-05-24 19:00:59.000000,0,96 2016-05-24 18:00:59.000000,8,96 2016-05-24 17:00:59.000000,15,96 2016-05-24 16:00:59.000000,20,96 2016-05-24 15:00:59.000000,19,96 2016-05-24 14:00:59.000000,3,96 2016-05-24 13:00:59.000000,6,96 2016-05-24 12:00:59.000000,9,96 2016-05-24 11:00:59.000000,13,96 2016-05-24 10:00:59.000000,16,96 2016-05-24 09:00:59.000000,11,96 2016-05-24 08:00:59.000000,1,96 2016-05-24 07:00:59.000000,5,96 2016-05-24 06:00:59.000000,2,96 2016-05-24 05:00:59.000000,0,96 2016-05-24 04:00:59.000000,0,96 2016-05-24 03:00:59.000000,0,96 2016-05-24 02:00:59.000000,0,96 2016-05-24 01:00:59.000000,0,96 2016-05-24 00:00:59.000000,0,96 2016-05-23 23:00:59.000000,0,96 2016-05-23 22:00:59.000000,0,96 2016-05-23 21:00:59.000000,0,96 2016-05-23 20:00:59.000000,4,96 2016-05-23 19:00:59.000000,0,96 2016-05-23 18:00:59.000000,0,96 2016-05-23 17:00:59.000000,0,96 2016-05-23 16:00:59.000000,3,96 2016-05-23 15:00:59.000000,5,96 2016-05-23 14:00:59.000000,2,96 2016-05-23 13:00:59.000000,18,96 2016-05-23 12:00:59.000000,10,96 2016-05-23 11:00:59.000000,7,96 2016-05-23 10:00:59.000000,9,96 2016-05-23 09:00:59.000000,1,96 2016-05-23 08:00:59.000000,1,96 2016-05-23 07:00:59.000000,1,96 2016-05-23 06:00:59.000000,1,96 2016-05-23 05:00:59.000000,1,96 2016-05-23 04:00:59.000000,1,96 2016-05-23 03:00:59.000000,1,96 2016-05-23 02:00:59.000000,1,96 2016-05-23 01:00:59.000000,1,96 2016-05-23 00:00:59.000000,1,96", sep=",", header=T) 这是一个jQuery插件,我尝试通过webpack加载fullcalendar.js和jQuery。我在这里按照例子(https://github.com/cagataycivici/angular2-webpack-starter)。

fullcalendar中,我将以下设置添加到package.json

"devDependencies"

并将以下设置添加到"fullcalendar": "^2.7.2", "jquery": "^2.2.4", "jquery-ui": "^1.10.5",

vendor.js

但问题是即使实际存在import 'script!jquery/dist/jquery.min.js'; import 'script!moment/moment.js'; import 'script!fullcalendar/dist/fullcalendar.js'; 标记,Primeng计划也不会在网页中呈现。我错过了什么吗?

1 个答案:

答案 0 :(得分:0)

你需要修改 angular-cli.json ,将它们添加到 angular-cli.json 文件

"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"
            ],