René's URL Explorer Experiment


Title: Component lifecycles differs on nativescript-angular and angular2 on web. · Issue #374 · NativeScript/nativescript-angular · GitHub

Open Graph Title: Component lifecycles differs on nativescript-angular and angular2 on web. · Issue #374 · NativeScript/nativescript-angular

X Title: Component lifecycles differs on nativescript-angular and angular2 on web. · Issue #374 · NativeScript/nativescript-angular

Description: I ran into this problem and I'll try to explain it here. With nativescript-angular the lifecycle hook ngOnDestroy isn't called when we navigate away from a page as it would be on web. Navigating back reuses the old component with natives...

Open Graph Description: I ran into this problem and I'll try to explain it here. With nativescript-angular the lifecycle hook ngOnDestroy isn't called when we navigate away from a page as it would be on web. Navigating ba...

X Description: I ran into this problem and I'll try to explain it here. With nativescript-angular the lifecycle hook ngOnDestroy isn't called when we navigate away from a page as it would be on web. Navig...

Opengraph URL: https://github.com/NativeScript/nativescript-angular/issues/374

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Component lifecycles differs on nativescript-angular and angular2 on web.","articleBody":"I ran into this problem and I'll try to explain it here.\n\nWith `nativescript-angular` the lifecycle hook `ngOnDestroy` isn't called when we navigate away from a page as it would be on web. Navigating back reuses the old component with `nativescript-angular` but a new instance is created on web.\n\nI've based an example on Nathan Walker's `angular2-seed-advanced`:\nhttps://github.com/m-abs/angular2-seed-advanced/tree/ngondestroy-not-triggered\n\nI've two component for my routes:\n[HomeComponent](https://github.com/m-abs/angular2-seed-advanced/blob/ngondestroy-not-triggered/src/client/app/components/about/about.component.ts) \n[AboutComponent](https://github.com/m-abs/angular2-seed-advanced/blob/ngondestroy-not-triggered/src/client/app/components/home/home.component.ts)\n\nEach component have a `instanceNo`, so we can identify multiple instances of the component.\n\n| Action | Web | TNS |\n| --- | --- | --- |\n| Launch application | HomeComponent\u003c1\u003e.ngOnInit() is called | HomeComponent\u003c1\u003e.ngOnInit() is called |\n| Click on 'ABOUT' | HomeComponent\u003c1\u003e.ngOnDestroy() followed by AboutComponent\u003c1\u003e.ngOnInit() | AboutComponent\u003c1\u003e.ngOnInit() |\n| Click on 'HOME' | AboutComponent\u003c1\u003e.ngOnDestroy() followed by HomeComponent\u003c2\u003e.ngOnInit() | HomeComponent\u003c2\u003e.ngOnInit() |\n| Click back | HomeComponent\u003c2\u003e.ngOnDestroy() followed by AboutComponent\u003c2\u003e.ngOnInit() | HomeComponent\u003c2\u003e.ngOnDestroy() |\n| Click back again | AboutComponent\u003c2\u003e.ngOnDestroy() followed by HomeComponent\u003c3\u003e.ngOnInit() | AboutComponent\u003c1\u003e.ngOnDestroy() |\n\nAs you can see the two behaves very differently.\n## On web:\n- Navigate to a new page, the current component is destroyed and a new is created.\n- Navigating hitting back, the current component is destroyed and a new is created.\n## With nativescript-angular:\n- Navigate to a new page, creates the new component but leaves the current component as is.\n- Navigating hitting back, the current component is destroyed and the old component is reused.\n\nIf you want to try for yourself, checkout my branch `ngondestroy-not-triggered` and run:\n## For web:\n\n``` bash\nnpm run start \n```\n## For nativescript-angular with android:\n\n``` bash\nnpm run start.livesync.android\n```\n\nShouldn't the two behave the same?\nSo components are destroyed when we navigate from a page and (re)created when we navigate to the page?\n","author":{"url":"https://github.com/m-abs","@type":"Person","name":"m-abs"},"datePublished":"2016-07-27T23:52:46.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":30},"url":"https://github.com/374/nativescript-angular/issues/374"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:95554203-7ddd-665b-652e-aa075a716ff8
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBCE8:140E58:5015136:67BB1AD:6975175E
html-safe-nonceef8294763ed84f587bb667416938e4c996acf60759d39f6ddeda1a65d2edf2c0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQ0U4OjE0MEU1ODo1MDE1MTM2OjY3QkIxQUQ6Njk3NTE3NUUiLCJ2aXNpdG9yX2lkIjoiMTI1NzE4Nzc5MDMxMTIwMDYwNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc7072d1a53870b156f7a321db7d9e0147a1f16a99024dc895a132ae2f6ecfa01
hovercard-subject-tagissue:167983236
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NativeScript/nativescript-angular/374/issue_layout
twitter:imagehttps://opengraph.githubassets.com/8825e3686c3a3004f6f8ab6c30a8d0ad55cbf8271d79c11c324b55982e74217a/NativeScript/nativescript-angular/issues/374
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8825e3686c3a3004f6f8ab6c30a8d0ad55cbf8271d79c11c324b55982e74217a/NativeScript/nativescript-angular/issues/374
og:image:altI ran into this problem and I'll try to explain it here. With nativescript-angular the lifecycle hook ngOnDestroy isn't called when we navigate away from a page as it would be on web. Navigating ba...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamem-abs
hostnamegithub.com
expected-hostnamegithub.com
None4a4bf5f4e28041a9d2e5c107d7d20b78b4294ba261cab243b28167c16a623a1f
turbo-cache-controlno-preview
go-importgithub.com/NativeScript/nativescript-angular git https://github.com/NativeScript/nativescript-angular.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id35951404
octolytics-dimension-repository_nwoNativeScript/nativescript-angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id35951404
octolytics-dimension-repository_network_root_nwoNativeScript/nativescript-angular
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release488b30e96dfd057fbbe44c6665ccbc030b729dde
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/NativeScript/nativescript-angular/issues/374#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fnativescript-angular%2Fissues%2F374
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fnativescript-angular%2Fissues%2F374
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=NativeScript%2Fnativescript-angular
Reloadhttps://github.com/NativeScript/nativescript-angular/issues/374
Reloadhttps://github.com/NativeScript/nativescript-angular/issues/374
Reloadhttps://github.com/NativeScript/nativescript-angular/issues/374
NativeScript https://github.com/NativeScript
nativescript-angularhttps://github.com/NativeScript/nativescript-angular
Please reload this pagehttps://github.com/NativeScript/nativescript-angular/issues/374
Notifications https://github.com/login?return_to=%2FNativeScript%2Fnativescript-angular
Fork 240 https://github.com/login?return_to=%2FNativeScript%2Fnativescript-angular
Star 1.2k https://github.com/login?return_to=%2FNativeScript%2Fnativescript-angular
Code https://github.com/NativeScript/nativescript-angular
Issues 294 https://github.com/NativeScript/nativescript-angular/issues
Pull requests 2 https://github.com/NativeScript/nativescript-angular/pulls
Actions https://github.com/NativeScript/nativescript-angular/actions
Security 0 https://github.com/NativeScript/nativescript-angular/security
Insights https://github.com/NativeScript/nativescript-angular/pulse
Code https://github.com/NativeScript/nativescript-angular
Issues https://github.com/NativeScript/nativescript-angular/issues
Pull requests https://github.com/NativeScript/nativescript-angular/pulls
Actions https://github.com/NativeScript/nativescript-angular/actions
Security https://github.com/NativeScript/nativescript-angular/security
Insights https://github.com/NativeScript/nativescript-angular/pulse
New issuehttps://github.com/login?return_to=https://github.com/NativeScript/nativescript-angular/issues/374
New issuehttps://github.com/login?return_to=https://github.com/NativeScript/nativescript-angular/issues/374
Component lifecycles differs on nativescript-angular and angular2 on web.https://github.com/NativeScript/nativescript-angular/issues/374#top
https://github.com/m-abs
https://github.com/m-abs
m-abshttps://github.com/m-abs
on Jul 27, 2016https://github.com/NativeScript/nativescript-angular/issues/374#issue-167983236
https://github.com/m-abs/angular2-seed-advanced/tree/ngondestroy-not-triggeredhttps://github.com/m-abs/angular2-seed-advanced/tree/ngondestroy-not-triggered
HomeComponenthttps://github.com/m-abs/angular2-seed-advanced/blob/ngondestroy-not-triggered/src/client/app/components/about/about.component.ts
AboutComponenthttps://github.com/m-abs/angular2-seed-advanced/blob/ngondestroy-not-triggered/src/client/app/components/home/home.component.ts
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.