Lanka Developers Community

    Lanka Developers

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Shop

    How to emit custom event in Framework7?

    Hybrid App Development
    framework7 events cordova
    2
    4
    942
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      fern Node.js last edited by

      Hello, I want to emit a custom event on user login, how can I achieve this in framework7?

      1 Reply Last reply Reply Quote 2
      • dev_lak
        dev_lak last edited by dev_lak

        you can attach event listener like below

        app.on('myCustomEvent', function (a, b) {
          console.log(a); // -> 'foo'
          console.log(b); // -> 'bar'
        });
        

        and emit event like below

        app.emit('myCustomEvent', 'foo', 'bar');
        

        also check their documentation

        F 1 Reply Last reply Reply Quote 2
        • F
          fern Node.js @dev_lak last edited by

          @dev_lak thanks, it worked well :honey_pot:

          1 Reply Last reply Reply Quote 2
          • dev_lak
            dev_lak last edited by

            welcome bro

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post

            1
            Online

            3.7k
            Users

            1.3k
            Topics

            5.3k
            Posts

            • Privacy
            • Terms & Conditions
            • Donate

            © Copyrights and All right reserved Lanka Developers Community

            Powered by Axis Technologies (PVT) Ltd

            Made with in Sri Lanka

            | |