question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: setPages and insertPages do not expose proper types

See original GitHub issue

Feature Request

Ionic version:

[x] 5.x

Describe the Feature Request Hello,

I have a ion-nav in a separate section of my app (independant of the Angular routing that I’m using for the main content of my app). And I would like to INSERT a stack of pages into this ion-nav at a specified index, the functions insertPages and setPages seems perfect but lacks documentation (also see https://github.com/ionic-team/ionic-docs/issues/1478) on how to pass props to components.

Describe Preferred Solution

To push a view one by one it’s :

@ViewChild("nav") nav: IonNav;

ngOnInit(): void {
  await this.nav.push(MyNewComponent, { input1: "value", input2: "value" });
}

And I would like to do something like :

@ViewChild("nav") nav: IonNav;

ngOnInit(): void {
  // Index 1
  await this.nav.insertPages(1, [
    { component: MyNewComponent, componentProps: { input1: "value", input2: "value" } },
    { component: MyNewComponent, componentProps: { input1: "value2", input2: "value2" } },
    { component: MyNewComponent, componentProps: { input1: "value2", input2: "value3" } }
  ]);
}

But this is currently not possible … It says incompatible with type NavComponent which is ComponentRef | ViewController. So I can do the following to have 0 errors but HOW to pass componentProps as well ??

@ViewChild("nav") nav: IonNav;

ngOnInit(): void {
  // Index 1
  await this.nav.insertPages(1, [ MyNewComponent, MyNewComponent, MyNewComponent ]);
}

I would appreciate any help …

doc : https://ionicframework.com/docs/api/nav cross-reference : https://forum.ionicframework.com/t/how-to-use-ionnav-insertpages/192561

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
liamdebeasicommented, Jul 15, 2020

Fixed setPages as well - thanks 👍

1reaction
liamdebeasicommented, Jul 15, 2020

Glad it works! Ah right I forgot to export NavComponentWithProps. I will make sure that gets updated in my PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Insert Pages Error | Adobe Acrobat
I get File Error Has Occurred. At first I thought it might be because I am trying to insert pages that are a...
Read more >
jspdf.js - Documentation
All pages have been added so the object ID can be estimated to start right after. // This does not modify the current...
Read more >
Bug descriptions — spotbugs 4.7.3 documentation
This is usually an error, as it does not aid garbage collection, ... guaranteed to use Object.clone(), which always returns an object of...
Read more >
Why does Acrobat insert pages backwords? A bug?
I run the document>insert pages command to merge them all into one pdf file, ... You are correct, Acrobat reader does not create...
Read more >
Erlang -- gl
C is not clamped. Rather, C is converted to a fixed-point value with unspecified precision to the right of the binary point. The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found