How would someone implement Modal navigation inside a tab navigation in Angular-Nativescript? - tabs

I've been struggling with the implementation of Modal Navigation inside Tab Navigation in Nativescript. So I wondered if someone had a good practice on how to implement what I am looking for.
I've tried multiple ways but none worked, I might lack some deep knowledge about router navigation since most error concerned navigation.
Here is a playground that tries to replicate what I am trying to achieve: https://play.nativescript.org/?template=play-ng&id=VdmiR9&v=8
Errors that often occurred were:
CONSOLE ERROR [native code]: ERROR Error: No componentRef found in DetachedRouteHandle
ERROR Error: Uncaught (in promise): Error: StaticInjectorError(AppModule)[FirstModalComponent -> ModalDialogParams]
(While the ModalDialogService was injected inside the AppModule)
No component factory found for RootModalComponent. Did you add it to #NgModule.entryComponents
(While the RootModalComponent was added to the entryComponents of the lazy loaded module, so I added it to the AppModule)
Can't resolve '~/app' in...
(This error is weird because in some projects, the lazy loading of modules works with this import '~/app' while in other projects it fails)
Error: Cannot match any routes. URL Segment: 'tabs/default'
(This error occurred all the time, it seems I did not totally grasp the way of implementing routes)
If someone knows a way to do modal navigation inside tab navigation, it would help me a lot.

Currently, modal navigation inside a tabview is somewhat buggy in the Nativescript Angular framework, but there is a workaround. You can find a full implementation of this modal navigation inside this playground sample: https://play.nativescript.org/?template=play-ng&id=TkK7sQ&v=5
Fir further info, take a look at this issue I created on their GitHub repo: https://github.com/NativeScript/nativescript-angular/issues/1774

Related

Angular material dialog problems - Can't get it to open a dialog?

Can anybody spot where I am going wrong with trying to open this dialog from a button click? I already have 3 different dialogs that work perfectly, but I just can't figure out what i am doing wrong...
I have made sure to include an import of the dialog-to-open.component.ts file in app.module.ts and everywhere else that the others have been imported into...
You're calling openFullDetailDialog(r.number) in template, but in component you only have openFullDetailDialog() with no arguments.
since you are passing data through click event you need to import MAT_DIALOG_DATA into the my-file.component.ts
I found that I was getting the console error:
Error: No component factory found for RaceDetailPopupComponent. Did you add it to #NgModule.entryComponents?
After a bit of Googling I found that I needed to add RaceDetailPopupComponent to my 'app.module.ts' file under the entryComponents:[] section.
My dialog now opens properly.
NB. I have no idea why this happened as I alread have 2 dialogs that open from the same location but with different outputs... They work without this entryComponents import.

Google chart : Container is not defined when html changes

I'm getting the error "Container is not defined" after I click on a different page while the api is loading.
I'm sure that my
var chartTwo = new google.visualization.PieChart(document.getElementById('donutchartDue'))
is working because the error doesn't pop up if I just wait on the same page until everything is loaded.
I believe the cause of this error is that my chart div is no longer there when my template changes while api is running in the background (basically html and apis are asynchronous). =(
Anyone got any idea on how to fix this?
Nvm guys, I used if (angular.element('#donutchartId').length) {} to check if the div exist before the charts get drawn and it worked

UItesting Xcode 7 - accessibility issue

I have added 'Home' title to the navigation item for the sake of accessibility, but it's still treated as a UIPageView
UI Test Activity:
Assertion Failure: XCTAssertEqual failed: ("Optional("UIPageView")") is not equal to ("Optional("Home")") -
It was not an accessibility issue with Xcode, I just selected the wrong controller (I'm using a UIPageViewController for navigation purposes), sorry for wasting your time ;P.

Content Dialog template in Visual Studio C#

I'm starting to learn Windows 8.1 phone development and I am trying to get the Content Dialog template to work inside a Pivot page. Work some reason, when I try to get the Add app bar button to navigate to the ContentDialog.xaml page, it is not displaying, but I see the navigate go to the ContentDialog constructor where the this.InitializeComponent() occurs.
I am finding very little online in way of examples on this template, so I am at a loss as to what I am missing. I understand that the ContentDialog page that was created from the template is inheriting from ContentDialog and not Page, but I'm not sure if this is still supposed to be directly accessed or if this XAML is supposed to be inside another "Page" XAML file.
Can someone please help.
The code looks like this in the Pivot page when the click event is selected:
Frame.Navigate(typeof(ContentDialog1));
I really haven't even touched the ContentDialog template from it's default yet, so it is set up like a set password page.
Thanks in advance
UPDATE
I found the answer to my question above. apparently, because it is a Content control, it needs to be called like a normal dialog would need to be called in it's code behind. I think my missconseption was that I thought it being "a template", that when I called it with the navigation calls that it would already have everything needed to get fired. You can also add the Content control to an existing page if you would like.
In either scenario, you need to add a method similar to this in your XAML.CS file.
private async void OpenDialog()
{
await this.contentStuff.ShowAsync();
}
You then need to call this method in the constructor. Then, when called, your dialog will appear.
Hope this helps others just starting out.

UIViewController navigation - Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted

In my app I use navigation controller to traverse between various viewcontrollers. I have view controllers A,B,C,D and E. I use push and pop to go back and forth. The issue is when the app is launched, I am able to traverse through the view controllers without any issues.
Before every push and pop I NSLog the view controller stack and it is as good as expected. But when I come to the root view controller again and start the navigation again, I am getting "nested push animation can result in corrupted navigation bar"
Even before the error when I NSLog the stack, the stack has no issues and is as expected. Then I get the error "Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted."
What is surprising is I am not able to debug because I am clueless where the error is coming from as NSLog of viewcontroller stack is fine. Kindly help me.
This article help me - http://keighl.com/post/ios7-interactive-pop-gesture-custom-back-button/
I just override UINavigationController.