angular - TypeError: undefined is not a constructor (evaluating 'new viewClass()') -
i using nativescript-intro-slides library, followed angular example mentioned facing error:
class listcomponent - inline template:1:8 original exception: typeerror: undefined not constructor (evaluating 'new viewclass()') original stacktrace: createandattach@file:///app/tns_modules/nativescript-angular/view-util.js:90:33
my code:
import {component,elementref, oninit, viewchild} "@angular/core"; import {registerelement} "nativescript-angular/element-registry"; registerelement("slide", () => require("nativescript-intro-slides").slide); registerelement("slidecontainer", () => require("nativescript-intro-slides").slidecontainer); @component({ moduleid: module.id, selector: "list-page", template: ` <slidecontainer angular="true" #slides> <slide *ngfor="let img of images"> <label [text]="img.title"></label> </slide> </slidecontainer> ` }) export class listcomponent implements oninit { public images: array<any> = []; @viewchild("slides") slides: elementref; ngoninit() { this.images.push({title: 'sports'}); this.images.push({title: 'cats'}); this.images.push({title: 'food'}); } ngafterviewinit() { let slidesxml = this.slides.nativeelement; slidesxml.constructview(); } }
plus not find method constructview. thank you
nativescript-intro-slides
library has lot of problems owner recommends using new version nativescript-slides
Comments
Post a Comment