Coder Social home page Coder Social logo

how to navigate about nativescript-sidedrawer HOT 9 OPEN

oncul avatar oncul commented on June 16, 2024 1
how to navigate

from nativescript-sidedrawer.

Comments (9)

ButterMeWaffle avatar ButterMeWaffle commented on June 16, 2024 1

@apologetics using a custom made side drawer and the exact same functions my issue was resolved. Somehow when the function is called, via the index function of the plugin, ngmodels do not like to work even with data present. This doesnt make much sense to me but I haven't had time to investigate it

from nativescript-sidedrawer.

orlowdev avatar orlowdev commented on June 16, 2024

This is what I did using Angular and TypeScript.

// All the code you need to set the drawer up
...
listener: (index) => {
  this.handleDrawerItemTap(index); // Call the function or place the switch right here
},
...
// All the rest

// Consider index to follow appropriate route. The order is 0-based and matches the order
// of your drawer items initialized in 'templates'. Bear in mind that you need to inject the 
// Router into your component.
private handleDrawerItemTap(index : number) : void {
  switch (index) {
    case 0:
      this.router.navigate(["/foo"]);
      break;
    ... // Other cases
  }
}

from nativescript-sidedrawer.

ButterMeWaffle avatar ButterMeWaffle commented on June 16, 2024

has anyone found an issue with data binding when using the above method?

When the above method is used my page is not populated with data.

However if I can to the exact same page from outside of the sidebar, the data appears as it should.

from nativescript-sidedrawer.

orlowdev avatar orlowdev commented on June 16, 2024

It could potentially take place, but it is not the problem with sidedrawer, this is due to the router behaviour. Code is needed to replicate the issue.

from nativescript-sidedrawer.

ecopenhex avatar ecopenhex commented on June 16, 2024

@SamuelGRwebfab could you attach the code? Please. I have the same issue, when click the model doesn't work. Thanks.

from nativescript-sidedrawer.

Saguntamrakar avatar Saguntamrakar commented on June 16, 2024

@SamuelGRwebfab I am having the same problem. Could you tell me how you did it?

from nativescript-sidedrawer.

Saguntamrakar avatar Saguntamrakar commented on June 16, 2024

I solved it by using this.routerextension.navigate(['/LeaveInfo'], {
clearHistory: true,
animated: false
}) instead of this.router.navigate(["/foo"]);

from nativescript-sidedrawer.

ButterMeWaffle avatar ButterMeWaffle commented on June 16, 2024

@ecolasurdo i switch to a custom radsidedrawer instead of using the plugin. however @Saguntamrakar fix may work but would cause history issues is you like to use the goBack function

from nativescript-sidedrawer.

sychus avatar sychus commented on June 16, 2024

Hi boys!
I have the same problem as @SamuelReeder !! I think that is a sidedrawer problem. If I use a button instead sidedrawer populates perfectly! Please Help!

from nativescript-sidedrawer.

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.