Giter VIP home page Giter VIP logo

Comments (7)

bradmartin avatar bradmartin commented on May 27, 2024

from nativescript-pulltorefresh.

dvdbrk avatar dvdbrk commented on May 27, 2024

Tried that as well... failed :'-(

from nativescript-pulltorefresh.

bradmartin avatar bradmartin commented on May 27, 2024

from nativescript-pulltorefresh.

dvdbrk avatar dvdbrk commented on May 27, 2024

home.component.html

  <PullToRefresh #pullToRefreshElement (refresh)="onPullRefresh($event)">
...
  </PullToRefresh>

home.component.ts

  import { Component, AfterViewInit, ElementRef, ViewChild } from "@angular/core";

  @ViewChild("pullToRefreshElement") pullToRefreshElement: ElementRef;

  ngAfterViewInit(){
    console.log('pullToRefresh element', this.pullToRefreshElement)
    console.log('pullToRefresh nativeElement', this.pullToRefreshElement.nativeElement)
    console.log('pullToRefresh nativeElement nativeView', this.pullToRefreshElement.nativeElement.nativeView)
    console.log('pullToRefresh nativeElement android', this.pullToRefreshElement.nativeElement.android)
 
    // doesn't work anyway
    // console.log('pullToRefresh', this.pullToRefreshElement.nativeView);
    // console.log('pullToRefresh', this.pullToRefreshElement.android);
    // console.log('pullToRefresh', this.pullToRefreshElement.nativeElement.nativeView);
  }

The console output

JS: pullToRefresh element [object Object]
JS: pullToRefresh nativeElement PullToRefresh(477)
JS: pullToRefresh nativeElement nativeView
JS: pullToRefresh nativeElement android

from nativescript-pulltorefresh.

dvdbrk avatar dvdbrk commented on May 27, 2024

Huh, I left all this debug info in... and now I keep receiving what I was expecting...

pullToRefresh nativeElement nativeView android.support.v4.widget.SwipeRefreshLayout{223e69b V.ED..... ......I. 0,0-0,0 #19}

Oh well... 😕

from nativescript-pulltorefresh.

bradmartin avatar bradmartin commented on May 27, 2024

So you got it figured out? If you're still having issues, the forums or the NS slack community are best to figure this out. I don't think there is an issue with the plugin specifically so let's keep the repo issues clean 👍 hopefully you're good to go now.

from nativescript-pulltorefresh.

dvdbrk avatar dvdbrk commented on May 27, 2024

Yes, it was one of those cases when the element does not actually exist on the page even after AfterViewInit. setTimeout fixed it 👍

from nativescript-pulltorefresh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.