-
-
Notifications
You must be signed in to change notification settings - Fork 241
Router and navigation #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
IMO integration with the router, or some alternative API, is an absolute necessity. I ran into this limitation about 30 minutes into trying to build a serious app, and others will as well. |
@hdeshev is there any work-around? I am new to Angular and maybe its me, but can't think of a way to have two pages and navigate between them without router. This won't do topmost().navigate("views/calendar") :) We have a native app in the stores and want to re-write it from scratch with {N} + Angular 2. Not really complicated but still will have more than a single view. |
We're working on something that seems promising, but has some issues on iOS. I'll probably document it, push it to master this week and improve it later. |
Very exciting! :) On Wed, Jan 13, 2016 at 3:30 AM Hristo Deshev [email protected]
|
@MiroValchev I have a workaround in my Groceries sample as well, but it’s definitely a bit hacky for now, so I’m also anxiously awaiting @hdeshev’s magic too 😀 |
Totally +1. Any progress on this? |
There was a merge today into mater related to the router: nsRouterLink directive looks interesting. It should be all there to set up the route config + base now. |
When I change page, angular destroys all components , and renders them again . |
@vakrilov I am using page-router-outlet . I 've tried the qsf example but that one has the problem too. and every time , when i click back and click the example again, it shows two logs in console. In common usage nobody would recognise this problem because angular 2 works very fast. However, in some complicated case, the re-rendering time takes too long. |
I have encountered the same issue as @anhoev on the page double loading components after the navigation changes (in my own project) and have put some workarounds for some observable subscriptions to understand that the controls are being destroyed... I could just dispose of it.... but laziness :) (and it doesn't stop the double HTTP requests to get data). I have some odd styling artifacts after navigation as well. Stack Panels in one of my components will get some extra padding (only after the first navigation, when the action bar jumps in). Navigating somewhere and back again fixes it to look like normal again. |
I think some more clarification about the navigation in NativeScript is needed. That should explain why the constructor for your start component is called only once , but when navigating forward and back to a second page - it is created every time. One thing you can do, is to use the DI and a service to cache your data to avoid unneeded HTTP requests. |
@matt4446 About that styling issue - it looks like a bug, Can you share some code so that we can reproduce it. |
@vakrilov If I can. |
@matt4446 Can you open another issue if you manage to reproduce it? Also we made some changes in the Page layout when showing/hiding the action bar so it is possible that this issue is fixed with the newer version of the NativeScript modules. Closing the issue - there is an example with nested navigation here and we will start working on the docs soon. |
* chore: clean-up app/package.json * chore: update to NativeScript 3.0 * chore: typo in button text * refactor: restructure dirs to use only kebab case * refactor: extract AppModule to separate file * refactor: stop creating navigatableComponents dynamically This prevented the app from being AoT compilatable. * feat: enable webpack + AoT compilation * chore: use next tags to ns-ng and core modules
Figure out if we can integrate with the Angular Router.
If the above isn't possible/feasible, offer a similar API.
The text was updated successfully, but these errors were encountered: