{"id":16660884,"url":"https://github.com/rbalet/ngx-back-button","last_synced_at":"2026-03-09T06:31:04.280Z","repository":{"id":165122956,"uuid":"640490723","full_name":"rbalet/ngx-back-button","owner":"rbalet","description":"Angular back button","archived":false,"fork":false,"pushed_at":"2026-03-02T19:12:26.000Z","size":863,"stargazers_count":8,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-02T22:24:06.993Z","etag":null,"topics":["angular"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rbalet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"rbalet","custom":"https://www.buymeacoffee.com/widness"}},"created_at":"2023-05-14T09:11:44.000Z","updated_at":"2026-01-31T17:29:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"bb08dafc-a99d-4f1b-bdc5-9ec5d22784f5","html_url":"https://github.com/rbalet/ngx-back-button","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/rbalet/ngx-back-button","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbalet%2Fngx-back-button","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbalet%2Fngx-back-button/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbalet%2Fngx-back-button/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbalet%2Fngx-back-button/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rbalet","download_url":"https://codeload.github.com/rbalet/ngx-back-button/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbalet%2Fngx-back-button/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30284774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:57:19.223Z","status":"ssl_error","status_checked_at":"2026-03-09T02:56:26.373Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular"],"created_at":"2024-10-12T10:32:06.629Z","updated_at":"2026-03-09T06:31:04.230Z","avatar_url":"https://github.com/rbalet.png","language":"TypeScript","readme":"# @ngx-back-button \nA library for handling a proper angular back button capability\n\n![NPM](https://img.shields.io/npm/l/ngx-back-button)\n[![npm version](https://img.shields.io/npm/v/ngx-back-button.svg)](https://www.npmjs.com/package/ngx-back-button)\n![npm bundle size](https://img.shields.io/bundlephobia/min/ngx-back-button)\n![npm](https://img.shields.io/npm/dm/ngx-back-button)\n\n1. Handle Browser history\n2. Handle `Fallback` when clicking on the back button when not routed yet\n3. Handle custom `Fallback`\n\n## Demo\n- https://stackblitz.com/~/github.com/rbalet/ngx-back-button\n\n## Installation\n\n```sh\nnpm install ngx-back-button\n```\n\nInside your `app.module.ts` file.\n```typescript\nimport { NgxBackButtonModule } from 'ngx-back-button'\n\n  imports: [\n    NgxBackButtonModule.forRoot({}), // Default rootUrl === '/'\n\n    // Or\n    NgxBackButtonModule.forRoot({\n      rootUrl: '/custom', // Or any custom root url\n      fallbackPrefix: '/tabs' // For libraries users\n    }),\n  ],\n```\n\n### rootUrl \nThe default fallback in case your landing on the page and have nothing to go back to\n\n### fallbackPrefix\nAdded to the fallback argument.\n\nUse: If you're building a library, wish to put some back button with fallback. \n\nLet say, you build a component that have the following \n```html\n\u003cbutton ngxBackButton=\"/login\"\u003e\n  Back to login\n\u003c/button\u003e\n```\n\nBut inside your app, you always have the `/tabs` first.\n\nAdding `fallbackPrefix: '/tabs'` will be the same as if you were doing the following\n\n```html\n\u003cbutton ngxBackButton=\"/tabs/login\"\u003e\n  Back to login\n\u003c/button\u003e\n```\n\n## Usage\nWherever you plan to use the back button logic\n\n```typescript\nimport { NgxBackButtonModule } from 'ngx-back-button'\n\nimports: [\n  NgxBackButtonModule,\n]\n```\n\nThen you can use it in two different way\n\n### Directive\nNormal use\n```html\n\u003cbutton ngxBackButton\u003e\n  Back button\n\u003c/button\u003e\n```\n\nWith Fallback\n```html\n\u003cbutton ngxBackButton=\"/login\"\u003e\n  Back to login\n\u003c/button\u003e\n```\n\n### Service\n```typescript\n// foo.component.ts\nimport { NgxBackButtonService } from 'ngx-back-button'\n\n// ...\n constructor(public ngxBackButtonService: NgxBackButtonService) {}\n```\n\nNormal use\n```html\n\u003cbutton (click)=\"ngxBackButtonService.back()\"\u003e\n  Back button\n\u003c/button\u003e\n```\n\nWith Fallback\n```html\n\u003cbutton (click)=\"ngxBackButtonService.back('/login')\"\u003e\n  Back to login\n\u003c/button\u003e\n```\n\n## Authors and acknowledgment\n* maintainer [Raphaël Balet](https://github.com/rbalet)\n* Inspired by [Nils Mehlhirn](https://nils-mehlhorn.de/posts/angular-navigate-back-previous-page/)\n\n[![BuyMeACoffee](https://www.buymeacoffee.com/assets/img/custom_images/purple_img.png)](https://www.buymeacoffee.com/widness)\n","funding_links":["https://github.com/sponsors/rbalet","https://www.buymeacoffee.com/widness"],"categories":["Third Party Components"],"sub_categories":["Router"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbalet%2Fngx-back-button","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frbalet%2Fngx-back-button","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbalet%2Fngx-back-button/lists"}