3

I work with Angular 2 + TypeScript. Right now in progress to add angular2-busy.

For this library I need to include angular2-dynamic-component, but I don't know what I must do with it.

This is error enter image description here

This is App Module

import {BusyModule} from 'angular2-busy/build/src';
import {DynamicComponentModule} from 'angular2-dynamic-component'

@NgModule({
imports: [        
    BusyModule,
    DynamicComponentModule
],

What is wrong and how to fix it?

UPDATE angular2-busy/busy.component.js

BusyComponent = __decorate([
    core_1.Component({
        selector: 'ng-busy',
        template: "\n        <div [class]=\"wrapperClass\" *ngIf=\"isActive()\" @flyInOut>\n            <DynamicComponent [componentTemplate]=\"template\" [componentInputData]=\"context\">\n            </DynamicComponent>\n        </div>\n    ",
        animations: [
            core_1.trigger('flyInOut', [
                core_1.transition('void => *', [
                    inactiveStyle,
                    core_1.animate(timing)
                ]),
                core_1.transition('* => void', [
                    core_1.animate(timing, inactiveStyle)
                ])
            ])
        ]
    }), 
    __metadata('design:paramtypes', [promise_tracker_service_1.PromiseTrackerService])
], BusyComponent);
return BusyComponent;

This is where the error appears.

Lucas
  • 9,871
  • 5
  • 42
  • 52
Dima Grigoriev
  • 357
  • 5
  • 22
  • What is "angular2-dynamic-component"? – Günter Zöchbauer Nov 11 '16 at 08:48
  • What are you trying to achieve with this [componentInputData] attribute. Assuming it's that directive, I don't see any such attribute documented in https://www.npmjs.com/package/angular2-dynamic-component. – JB Nizet Nov 11 '16 at 08:49
  • i don't know why it's need, but else i can't include angular2-busy, if you have some propositions, please – Dima Grigoriev Nov 11 '16 at 08:50
  • 'I don't see any such attribute' they are installed in packeg.json and configured in setup.js – Dima Grigoriev Nov 11 '16 at 08:51
  • Add the template file also. – lintu Nov 11 '16 at 08:52
  • 'Add the template file also' - what he must contain? – Dima Grigoriev Nov 11 '16 at 08:53
  • 1
    Start being rational here. Read the error message. It complains, clearly, about the attribute `[componentInputData]` that you used in your template. You chose to add that to your template. And it causes the error. So my question is: why do you have that in your template? What is the goal? Where have you found in the documentation that this attribute existed and did something? – JB Nizet Nov 11 '16 at 08:57
  • There is a reason of my qeustion, i don't have this attrubite, a don't have anything connected with him. I've just included angular2-busy and had error,after researching i've found that he has reference to angular2-dynamic-component and i've include this library – Dima Grigoriev Nov 11 '16 at 09:02
  • I had the same problem and instead of dynamiccomponent i used componentOutlet. – C.B. Nov 11 '16 at 11:05
  • it complain that is can't find a 'componentInputData' attribute, you can try to add @Input() before the 'componentInputData' – Zealitude Dec 12 '16 at 06:39

1 Answers1

2

I also had this problem before, and I resolved it by deleting the following:

<DynamicComponent [componentTemplate]=\"template\" [componentInputData]=\"context\">\n            </DynamicComponent>\n        </div>\n   
Shaohao
  • 3,471
  • 7
  • 26
  • 45
Diponchik
  • 21
  • 4