ng-dynamic-component icon indicating copy to clipboard operation
ng-dynamic-component copied to clipboard

Can't bind to 'ndcDynamicInputss' since it isn't a known property of 'ndc-dynamic'.

Open ArnaudFelixParis opened this issue 4 years ago • 17 comments

Hello,

I'm getting the errors : Can't bind to 'ndcDynamicInputs' since it isn't a known property of 'ndc-dynamic'. and Can't bind to 'ndcDynamicOutputs' since it isn't a known property of 'ndc-dynamic'. when I add the [ndcDynamicInputs] and [ndcDynamicOutputs] inputs binding to <ndc-dynamic></ndc-dynamic>.

My template : <gridster-item [item]="widget.disposition" *ngFor="let widget of widgets"> <ndc-dynamic [ndcDynamicComponent]="widget.component" [ndcDynamicInputs]="widget.inputs" [ndcDynamicOutputs]="widget.outputs"> </ndc-dynamic> </gridster-item>

The module imports : imports: [ CommonModule, .... , DynamicComponentModule, DynamicIoModule, DynamicModule ],

Angular 9.1.6 ng-dynamic-component 6.1.0

I also tried with <ng-template> and <ng-container> methods, same result ...

What's wrong ?

Thanks a lot

ArnaudFelixParis avatar Jun 03 '20 13:06 ArnaudFelixParis

Hi, please create a reproduction online on stackblitz so I can see and verify it. Otherwise I'm not able to help.

gund avatar Jun 03 '20 19:06 gund

hi Guys,

i got the same issue... impossible to load [ndcDynamicInputs] & [ndcDynamicOutputs]

angular 9.1.9 with nx

@NgModule({ imports: [ DynamicModule.forRoot(),DynamicIoModule, DynamicComponentModule ], exports: [ DynamicPanelComponent

], declarations: [DynamicPanelComponent] }) export class SharedUtilityModule {}

tried also in app.module.ts same result

tried all 3 methods

<ndc-dynamic [ndcDynamicComponent]="panelService.panelComponent | async" (ndcDynamicCreated="")>

<ng-template [ngComponentOutlet]="panelService.panelComponent | async"></ng-template>

<ng-container *ngComponentOutlet="panelService.panelComponent | async;"></ng-container>

can not use in the tree methods...

Any idea,

very big thanks

trackx2k14 avatar Jun 15 '20 09:06 trackx2k14

When I try to import DynamicIoModule in app.module.ts, I get "Class DynamicIoModule is not an Angular module." Angular 6.0.7, ng-dynamic-component 6.1.0

BluefishTom avatar Jun 21 '20 22:06 BluefishTom

@BluefishTom you cannot use v6 with Angular v6. Please read the readme file for more info.

gund avatar Jun 22 '20 17:06 gund

My apologies, I meant Angular 9.0.7. I need to type more carefully.

BluefishTom avatar Jun 22 '20 17:06 BluefishTom

Oh in that case I would also ask you to please prepare some online demo with the issue because I am not able to help you otherwise.

gund avatar Jun 22 '20 18:06 gund

got the exact same problem in 6.1.0 and angular 9, it still compile but

    <ng-template let-menu>
      <div class="menu-container">
        <ndc-dynamic
          (ndcDynamicCreated)="componentCreated($event)"
          [ndcDynamicComponent]="type"
          [ndcDynamicInputs]="inputs" <= can't bind
          [ndcDynamicOutputs]="outputs" <= can't bind
        >
        </ndc-dynamic>
      </div>
    </ng-template>

I am importing correctly

import { DynamicComponentModule, DynamicIoModule } from "ng-dynamic-component";

It still compile and don't crash, but the template file is always red with error.

I tried to make a stackblitz, but I can't manage to have it underline the errors.

popoleeMaster avatar Aug 02 '20 05:08 popoleeMaster

If your app compiles and has no runtime errors it means that everything is correct and fine. This is most likely an issue with your IDE. Try restarting it. Sometimes opening the module file of the component helps IDE to analyze it.

gund avatar Aug 02 '20 13:08 gund

Hi,

I'm currently facing the same issue. Im using Angular 9 with ng-dynamic-component 6.1.0.

<ndc-dynamic [ndcDynamicComponent]="currentComponent" [ndcDynamicInputs]="inputs" [ndcDynamicOutputs]="outputs"></ndc-dynamic>

I can't compile it as it shows "Can't bind to 'ndcDynamicOutputs' since it isn't a known property of 'ndc-dynamic'."

This is what I see when i go into the component

export declare class DynamicComponent implements OnChanges, DynamicComponentInjector {
    private vcr;
    private cfr;
    ndcDynamicComponent: Type;
    ndcDynamicInjector: Injector;
    ndcDynamicProviders: StaticProvider[];
    ndcDynamicContent: any[][];
    ndcDynamicCreated: EventEmitter>;
    componentRef: ComponentRef | null;
    constructor(vcr: ViewContainerRef, cfr: ComponentFactoryResolver);
    ngOnChanges(changes: SimpleChanges): void;
    createDynamicComponent(): void;
    private _resolveInjector;
}

There is no ndcDynamicInputs and ndcDynamicOutputs.

leeus99 avatar Aug 14 '20 07:08 leeus99

My problem was fixed when I used @no-barrels version ( 7.0.2-no-barrels.2)

yupio avatar Aug 14 '20 17:08 yupio

@gund it does compile and have no error, but I am in the same situation with @leeus99 it shouldn't compile at all since the definition do not exist

popoleeMaster avatar Aug 23 '20 11:08 popoleeMaster

ndc-dynamic is a component and ndcDynamicInputs is a directive so you will not see one in another's definition.

Again if your app does compile and there are no runtime errors - there is no problem with the library but with your dev IDE.

Also you might want to try @no-barrels NPM tag and see if the error in IDE goes away.

gund avatar Aug 23 '20 11:08 gund

Try https://github.com/93Alliance/ngx-dyncmp

93Alliance avatar Sep 20 '20 09:09 93Alliance

I'm having the same problem, and using the 7.0.2-no-barrels.2 version fixes it as well

omnibrain avatar Nov 06 '20 13:11 omnibrain

npm i ng-dynamic-component@no-barrels

Perhaps no-barrels should be the main line?

Jrubzjeknf avatar Nov 10 '20 09:11 Jrubzjeknf

Just to clarify is this issue also happening in the applications not just libraries?

gund avatar Nov 10 '20 14:11 gund

I had the same issue, where everything works, but I have the error message mentioned in the title in my IDE (VSCode)

I don't think it's an issue with the project, because it compiles and runs fine, the error is only showing up in the IDE not during execution or when I compile. Maybe it's a problem with TSLint?

Installing the no-barrels version did solve the issue for me.

I suggest that this could be added to the ReadMe.

shadowmax31 avatar Feb 04 '21 15:02 shadowmax31

I'm closing this issue as it's outdated. If you want to reopen the discussion please feel free to open a new issue.

gund avatar Aug 28 '22 01:08 gund