ng2-dragula

Click event in ng2-dragula bag not working

人盡茶涼 提交于 2020-01-17 08:02:52
问题 I'm using Angular 2 and ng2-dragula . I want to make the drag 'n' drop items in a dragula bag clickable. This is my app.component.html : <div id="rootFrame"> <div class="tasksFrame"> <div id="tasksCont" class='container' [dragula]='"first-bag"'> <div (click)="onClick('ha')">Task 1</div> <div (click)="onClick('ba')">Task 2</div> <div (click)="onClick('ca')">Task 3</div> </div> </div> <div class="editorFrame"> <div id="editorCont" class='container' [dragula]='"first-bag"'> </div> </div> <div

Uncaught TypeError: ctorParameters.map is not a function

南笙酒味 提交于 2019-12-24 00:25:52
问题 I am trying ti use dragula in my angular2 app. Here is the app.module in my code: import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { HttpModule } from '@angular/http'; import { DragulaService, DragulaModule } from 'ng2-dragula/ng2-dragula'; import { AppComponent } from './app.component'; import { PlayComponent } from './play/play.component'; import {SelectedInstrumentsService} from '.

Disable/Don't offer some drop locations on ng2-dragula

家住魔仙堡 提交于 2019-12-13 03:33:02
问题 I have some placeholder elements, which should not be used as drop location. Is there an option to disable some drop locations or to hide some drop locations? I know that you shouldn't do this Do not add any child elements that aren't meant to be draggable but isn't that, what accepts is for? this.dragulaService.createGroup('cards', { accepts: (el, target, source, sibling) => { if (sibling !== null && sibling.classList.contains('invisible')) return false; return true; } }); The issue is that

ng2-dragula setOptions and drop version problem

白昼怎懂夜的黑 提交于 2019-12-11 10:25:01
问题 Apparently 1.5.0 support this.dragulaService.setOptions while 2.1.1 doesn't and in reverse while 2.1.1 support this.dragulaService.drop subscribe 1.5.0 doesn't. Stackblitz Fork for 1.5.0 Stackblitz Fork for 2.1.1 Relevant code to notice: 1.5.0 (not working) (Error): Cannot invoke an expression whose type lacks a call signature. Type 'EvenEmitter' has no compatible call signatures. (property) AppComponent.dragulaService: DragulaService this.dragulaService.drop("dnd") .subscribe(({ name, el,

ng2-dragula with a virtual scroll

て烟熏妆下的殇ゞ 提交于 2019-12-11 08:07:12
问题 I am trying to implement ngx-virtual-scroll and ng2-dragula together here is my current Stackblitz UPDATED : Stackblitz The problem is the following : <virtual-scroller #scroll2 [id]="myGroupId" [dragula]="myGroupId" [(dragulaModel)]="myList.list2" [items]="myList.list2" class="virtual-scroller"> <div class="virtual-scroller-element" *ngFor="let card of myList.list2; let i = index ">{{myList.list2[i]}}</div> </virtual-scroller> for Dragula to work, there must be no HTML in between the group

Cannot drag and drop with protractor in website using ng2-dragula

时间秒杀一切 提交于 2019-12-08 07:26:48
问题 My company project website has a drag and drop block based on ng2-dragula. This is fundamental function but i cannot use protractor to drag and drop successfully even i tried a lot of ways. Someone has the same issue with me. As i know there is no way to proceed E2E test with dragula https://github.com/bevacqua/angularjs-dragula/issues/86. WebDriver Drag and Drop in application using Dragula Protractor/Jasmine drag and drop only grabbing text not the element https://github.com/bevacqua

ng2-dragula [dragula] (angular2 drag and drop) - *ngFor with [dragulaModel] attribute not working

為{幸葍}努か 提交于 2019-12-07 04:30:39
问题 Using ng2-dragula drag and drop wrapper library for angular 2 dragula. https://github.com/valor-software/ng2-dragula Seeing issues with the [dragulaModel]='myList' ... when the item gets dropped ... poof ... it disappears. Inspecting the element, I see it remains in model, but the DOM element loses its inner html (becomes empty div) - causing the div to "appear" to be hidden. import { Component } from '@angular/core'; import { DragulaService } from 'ng2-dragula/ng2-dragula'; @Component({

ng2-dragula [dragula] (angular2 drag and drop) - *ngFor with [dragulaModel] attribute not working

浪子不回头ぞ 提交于 2019-12-05 06:19:49
Using ng2-dragula drag and drop wrapper library for angular 2 dragula. https://github.com/valor-software/ng2-dragula Seeing issues with the [dragulaModel]='myList' ... when the item gets dropped ... poof ... it disappears. Inspecting the element, I see it remains in model, but the DOM element loses its inner html (becomes empty div) - causing the div to "appear" to be hidden. import { Component } from '@angular/core'; import { DragulaService } from 'ng2-dragula/ng2-dragula'; @Component({ moduleId: module.id, selector: 'my-app', template: ` <div> <div class='wrapper'> <div class='container'

How to disable drag some element on ng2-dragula

倖福魔咒の 提交于 2019-12-01 16:08:42
问题 I want to display name group on the top and cancel the drag event on it. How can I disable moving some element like if this group name on the top. My code is: dragulaService.drag.subscribe((value) => { console.log(`drag: ${value[0]}`); }); My template : <div class='wrapper'> <div class='container' *ngFor='let group of groups' [dragula]='"nested-bag"'> <div class="center-block">Table Number : {{group.name}}</div> <div *ngFor='let item of group.items' [innerHtml]='item.name'></div> </div> </div

Angular 7: Uncaught ReferenceError: global is not defined when adding package

血红的双手。 提交于 2019-12-01 01:37:29
问题 I am building an Angular 7 app, and when i add a package npm install dragula --save and import this into the pollyfills.ts file i get this error: index.js:2 Uncaught ReferenceError: global is not defined at Object../node_modules/custom-event/index.js (index.js:2) at webpack_require (bootstrap:83) at Object../node_modules/crossvent/src/crossvent.js (crossvent.js:3) at webpack_require (bootstrap:83) at Object../node_modules/dragula/dragula.js (dragula.js:4) at webpack_require (bootstrap:83) at