I've created an ionic 2 app and I'm trying to add dragula. I've installed and imported the ng2-dragula.
In the app.module.ts :
import { DragulaModule, DragulaService } from 'ng2-dragula/ng2-dragula';
and passed them to the imports and the providers.
In the component I have also imported the dragula service and subscribed for some of it events:
And in the template I have:
<ion-content> <ion-list [dragula]="'my-bag'" [dragulaModel]="appPages" > <button ion-item menuClose *ngFor="let p of appPages" (click)="openPage(p)"> <ion-icon item-left [name]="p.icon"></ion-icon> {{p.title}} </button> <button ion-item menuClose (click)="addNew()"> Add new </button> </ion-list> </ion-content>
but when I drag any button in the list and then drop it, it doesn't change its position and in the console I've got printed only 0. Am I missing something ? I seems that the drop event is never fired.
I've created an ionic 2 app and I'm trying to add dragula. I've installed and imported the ng2-dragula. In the app.module.ts :
import { DragulaModule, DragulaService } from 'ng2-dragula/ng2-dragula';
and passed them to the imports and the providers.In the component I have also imported the dragula service and subscribed for some of it events:
`dragulaService.drag.subscribe((value) => { console.log(value); console.log('0'); }); dragulaService.remove.subscribe((value) => { console.log(value); console.log('1'); });
And in the template I have:
<ion-content> <ion-list [dragula]="'my-bag'" [dragulaModel]="appPages" > <button ion-item menuClose *ngFor="let p of appPages" (click)="openPage(p)"> <ion-icon item-left [name]="p.icon"></ion-icon> {{p.title}} </button> <button ion-item menuClose (click)="addNew()"> Add new </button> </ion-list> </ion-content>
but when I drag any button in the list and then drop it, it doesn't change its position and in the console I've got printed only 0. Am I missing something ? I seems that the drop event is never fired.