2017-09-23 53 views
1

我在https://github.com/SortableJS/angular-sortablejs以下和systemjs.config.js是卡住的地方。我有一個離子3角4應用程序。離子3角製作sortableJs工作使用systemjs.config.js腳本

我在資產/ JS創建了一個名爲systemjs.config.js腳本/然後包括它在我的index.html作爲在頭節最後行

<script src="assets/js/systemjs.config.js"></script> 

然而,這樣做,它抱怨它無法找到系統。這是腳本中的最後一行 System.config(config);

如果我忽略上述步驟,那麼我最終不能綁定sortablejs屬性錯誤。我的.ts和.html看起來象下面這樣:

<h2>Drag/drop the item</h2> 
     <div [sortablejs]="items"> 
     <div *ngFor="let item of items">{{ item }}</div> 
     </div> 

     <hr> 

     <h2>See the result</h2> 
     <div> 
     <div *ngFor="let item of items">{{ item }}</div> 
     </div> 

.TS

import { Component, ViewChild, AfterViewInit } from '@angular/core'; 
@Component({ 
    selector: 'dynamic-home', 
    templateUrl: 'dynamic-home.html' 
}) 
export class DynamicHomeComponent implements AfterViewInit{ 
    items = [1, 2, 3, 4, 5]; 
} 

app.module.ts

​​

dyamicHome.ts

import { sortablejs } from 'sortablejs' 

回答