matsura / ng2-dual-list-box

A dual list box component for Angular 4
http://ng2-duallistbox-demo.surge.sh/
28 stars 20 forks source link

DualListBox doesn't work after ng build --aot #13

Closed alexander-kovalev closed 6 years ago

alexander-kovalev commented 7 years ago

Version 1.0.5 of DualListBox doesn't work after ng build --aot

@ angular/cli: 1.3.2 node: 7.10.0 os: win32 x64 @ angular/animations: 4.3.6 @ angular/common: 4.3.6 @ angular/compiler: 4.3.6 @ angular/core: 4.3.6 @ angular/forms: 4.3.6 @ angular/http: 4.3.6 @ angular/platform-browser: 4.3.6 @ angular/platform-browser-dynamic: 4.3.6 @ angular/router: 4.3.6 @ angular/cli: 1.3.2 @ angular/compiler-cli: 4.3.6

HarishVJ commented 6 years ago

Im too facing the same issue , does any one have solution for this . It also fails with this command ng build --prod .

sencersoylu commented 6 years ago

I have same problem.

ajocana commented 6 years ago

I have the same problem. Are you going to fix it?

muralihkr commented 6 years ago

I have same problem when used with ng build --prod. any workaround available to solve this issue ?

slavede commented 6 years ago

I have the same issues. This is bad since this is quite good component and it's not maintained anymore :(

slavede commented 6 years ago

If you take entire source code and put it into your project it will work fine, but that's not long term way to go. I'll fork this project and add building with ng-packagr which is quite good for building angular projects and I'll publish some new minor update

slavede commented 6 years ago

Opened PR https://github.com/matsura/ng2-dual-list-box/pull/21. If you want, you can use for now slavede-ng-dual-list-box until this one is merged.

Rajh commented 5 years ago

@slavede Hi,

I tried your version "slavede-ng-dual-list-box": "1.1.5" But it still doesn't work :

ERROR in ./src/$$_gendir/~/slavede-ng-dual-list-box/slavede-ng-dual-list-box.ngfactory.ts
Module not found: Error: Can't resolve 'slavede-ng-dual-list-box/src/models/index' in '...\src\$$_gendir\node_modules\slavede-ng-dual-list-box'
 @ ./src/$$_gendir/~/slavede-ng-dual-list-box/slavede-ng-dual-list-box.ngfactory.ts 7:0-132
 @ ./src/$$_gendir/app/models/model-list/model-list.component.ngfactory.ts
 @ ./src/$$_gendir/app/app.module.ngfactory.ts
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts
slavede commented 5 years ago

How are you using it?

Rajh commented 5 years ago

I do : module.ts

import { DualListBoxModule } from 'slavede-ng-dual-list-box';
@NgModule({
  imports: [
...
DualListBoxModule

component.ts import { DualListBoxComponent } from 'slavede-ng-dual-list-box';

component.html <ng2-dual-list-box #dualListBoxNew [data]="labelList" valueField="id" textField="name" [(ngModel)]="labelSelectedList"></ng2-dual-list-box>

Its working in dev mod, but not working with ng serve --aot

Rajh commented 5 years ago

@slavede do you have any idea ?

I can't compile in --prod due to this bug. The ng2-dual-list-box has not been updated to fix this bug and work with angular 4.x. And I've an error with yours "slavede-ng-dual-list-box" which doesn't compile in --prod neither.

I can't open an issue on your github repo.

sarveshnineleaps commented 5 years ago

@slavede selected item is not coming to the right side box as I am trying in angular 5

<ng2-dual-list-box [data]="pickListVals[idx]" valueField="id" textField="name" [ngModel]="currentVal[idx]" (onAvailableItemSelected)="appendSelectedValues($event, idx)" (onSelectedItemsSelected)="appendSelectedValues($event, idx)" (onItemsMoved)="appendSelectedValues($event, idx)">