Aurelia与独立库集成

时间:2016-07-05 05:11:00

标签: javascript aurelia jspm daypilot-scheduler

我正在研究aurelia + scheduler poc。我找到了一个独立的js库来显示会议事件。问题是将这个js与aurelia整合在一起。我正在使用jspm来下载项目依赖项。

是否有人试图将独立的js库与aurilia集成。

以下是我正在尝试集成的库。

http://javascript.daypilot.org/demo/scheduler/scalehours.html。     

<ai-dialog-body>      

<script>

    function sample(){

    var dp = new DayPilot.Scheduler("dp");

    dp.startDate = new DayPilot.Date("2016-06-28"); 

    dp.cellGroupBy = "Month";
    dp.days = 1;

    dp.cellDuration = 1440;

    dp.timeHeaders = [
        { groupBy: "Day" },
        { groupBy: "Cell" }
    ];
    dp.scale = "Hour";    
    dp.bubble = new DayPilot.Bubble();
    dp.treeEnabled = true;
    dp.rowHeaderWidth = 200;
    dp.resources = [{"id":"test@xyz.com","name":"Test"}];
    dp.events.list = [{"start":"2016-06-27T16:30:00","end":"2016-06-27T17:00:00","text":"Busy","resource":"test@xyz.com","id":2170}] 
    dp.cellWidth = 60;
    dp.init();
}
</script> 
<div id="dp"></div>       
<button onclick="sample()">Ok</button>
</ai-dialog-body>

当引用第三方库类获取以下消息时。

ReferenceError:未定义样本

1 个答案:

答案 0 :(得分:0)

您是否尝试下载源代码,然后在html中引用它:

<body aurelia-app>
    <script src="jspm_packages/system.js" charset="utf-8"></script>

    <!-- Place a referece to the downloaded library here -->

    <script src="config.js" charset="utf-8"></script>
    <script type="text/javascript">
        System.import("aurelia-bootstrapper");
    </script>
</body>