qlik-demo-team / qdt-components

React Components to be used with Angular 10, React 16 and Vue 2. Connects with the Capability API and Engine API.
MIT License
92 stars 50 forks source link

Component type QdtCurrentSelections not rendering #26

Closed sunpar closed 6 years ago

sunpar commented 6 years ago

Getting the error "qdt-components.js:11 Unhandled promise rejection TypeError: N.default.uid is not a function" when trying to use the current selections type.

My angular 6 component:

@Component({
    selector: 'qdt-component',
    templateUrl: './qdt-component.component.html',
    styleUrls: ['./qdt-component.component.css']
})
export class QdtComponent implements OnInit {

    static qdtComponents = new QdtComponents(options.config, options.connections);

    @Input() type: string;
    @Input() props: object;

    constructor(private elementRef: ElementRef) { }

    ngOnInit() {
        QdtComponent.qdtComponents.render(this.type, this.props, this.elementRef.nativeElement);
        console.log(this.type, this.props, this.elementRef.nativeElement);
    }

}

And usage:

<qdt-component [type]="viz1.type" [props]="viz1.props"></qdt-component>
private viz1: any = {
        type: 'QdtCurrentSelections',
        props: {
            height: '40px'
        },
    };
sunpar commented 6 years ago

I think I found the culprit: a typo in the qdtcurrentselections component. I've submitted a pull request for it.

yianni-ververis commented 6 years ago

Thank you Sundeep for the fix