hello guys,
iam still new in nativescript+angular. and now iam developing an app that need use slide.
and every time i slide , i have to change color of indicator. and i wanna get current index of what slide i am at.
this is my Html :
<Slides:SlideContainer angular="true" #slides pageIndicators="true" pagerOffset= "75%" (changed)="OnChange()">
and this is my .ts :
import { Component, ElementRef, OnInit, ViewChild } from "@angular/core";
import {registerElement} from "nativescript-angular/element-registry";
import { Page } from "ui/page";
import * as slide from 'nativescript-slides/nativescript-slides'
registerElement("Slide", () => require("nativescript-slides").Slide);
registerElement("SlideContainer", () => require("nativescript-slides").SlideContainer);
@Component({
selector: "LoginPage",
moduleId: module.id,
templateUrl: "./login-page.component.html",
styleUrls: ["./login-page.component.css"]
})
export class LoginPageComponent implements OnInit {
@ViewChild("slides") slides: ElementRef;
constructor(private page : Page) {
/* ***********************************************************
* Use the constructor to inject app services that you need in this component.
*************************************************************/
page.actionBarHidden=true;
}
ngOnInit(): void {
/* ***********************************************************
* Use the "ngOnInit" handler to initialize data for this component.
*************************************************************/
}
OnChange(args){
let slideContainer = args.object; <-- this trigger the error
console.log(slideContainer.currentIndex);
}
btnClicked(){
console.log("tab!!!");
}
ngAfterViewInit() {
let SlidesXml = this.slides.nativeElement;
SlidesXml.constructView();
}
}
thx.
hello guys, iam still new in nativescript+angular. and now iam developing an app that need use slide. and every time i slide , i have to change color of indicator. and i wanna get current index of what slide i am at.
this is my Html : <Slides:SlideContainer angular="true" #slides pageIndicators="true" pagerOffset= "75%" (changed)="OnChange()">