Giter VIP home page Giter VIP logo

Comments (3)

leocaseiro avatar leocaseiro commented on May 27, 2024 2

You just need to call the refresh event:

<PullToRefresh (refresh)="refreshList($event)">
    <ListView [items]="groceryList" row="2" class="small-spacing" [class.visible]="listLoaded">
        <template let-item="item">
            <Label [text]="item.name" class="medium-spacing"></Label>
        </template>
    </ListView>
</PullToRefresh>
class YourComponent {
    refreshList(args) {
        console.log('do refresh');
    }
}

from nativescript-pulltorefresh.

bradmartin avatar bradmartin commented on May 27, 2024

There is a refresh event on the component. I'm not sure about ng2 as I
don't use it yet but it does work as I've seen people using it on the slack
channel. So I'm guessing just add the refresh event, look at the sample on
the README

On Thu, Jul 7, 2016, 8:23 AM Yunus Emre Uluçay [email protected]
wrote:

I want to add your component to my {N} Angular app.

and added this in my component ts file.

import { registerElement, ViewClass } from "nativescript-angular/element-registry";

registerElement("PullToRefresh", () => {
var viewClass = require("nativescript-pulltorefresh").PullToRefresh;
return viewClass;
});

in the view page used it like that

It works and refresh spinner is shown on the top of the list when you pull
down. But it should somehow trigger a method. lets suppose method name is

refreshList(){}

how will I use it from the view?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/bradmartin/nativescript-pulltorefresh/issues/11, or mute
the thread
https://github.com/notifications/unsubscribe/AFulhDVGXHezDaKYirg4YazFpK3uxyX_ks5qTP3pgaJpZM4JHEp_
.

from nativescript-pulltorefresh.

bradmartin avatar bradmartin commented on May 27, 2024

Closing @yeulucay - if you need help using this see above comment.

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.