Angular2 Dragula模型未更新

Flo*_*nce 1 model dragula angular

我在项目中使用ng2-dragula,拖放时无法进行模型更新

<ul style="list-style-type: none;">
   <li *ngFor="let item of itemList" [dragula]='"bag-one"'          [dragulaModel]='itemList' >
      <div >
           {{item.label | itemFilter:user.language}}
          <a (click)="delete(item)" style="cursor:pointer;">delete</a>
       </div>
     </li>
    </ul>
Run Code Online (Sandbox Code Playgroud)

我组件的一部分:

@Component({
   moduleId: module.id,
   selector: 'item-user',
    templateUrl: 'item.component.html',
    styleUrls: ['item.component.css'],
    pipes: [itemFilter],
    directives: [Dragula] 
Run Code Online (Sandbox Code Playgroud)

...

我的根本组成部分的一部分

@Component({
    .....
    viewProviders: [DragulaService]
Run Code Online (Sandbox Code Playgroud)

拖放工作正常,put itemList(模型)未更新(控制台无错误)为什么?

Sov*_*iut 5

您需要将Dragula指令上移至“ bag”级别。

<ul style="list-style-type: none;" [dragula]='"bag-one"' [dragulaModel]='itemList'>
   <li *ngFor="let item of itemList">
       ...
Run Code Online (Sandbox Code Playgroud)