diff --git a/package.json b/package.json index 1a08b0b..9c07575 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,8 @@ "watch": "ng build --watch --configuration development", "test": "ng test", "test:ci": "ng test ngx-back-button --watch=false --code-coverage --no-progress --browsers=ChromeHeadless", - "publish": "ng build ngx-back-button --configuration production && npm publish ./dist/ngx-back-button" + "publish": "ng build ngx-back-button --configuration production && npm run copy-files && npm publish ./dist/ngx-back-button", + "copy-files": "cp README.md dist/ngx-back-button && cp LICENSE dist/ngx-back-button" }, "dependencies": { "@angular/animations": "^18.2.10", diff --git a/projects/ngx-back-button/LICENSE b/projects/ngx-back-button/LICENSE deleted file mode 100644 index a1ead46..0000000 --- a/projects/ngx-back-button/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 Raphaël Balet - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/projects/ngx-back-button/README.md b/projects/ngx-back-button/README.md deleted file mode 100644 index e111c41..0000000 --- a/projects/ngx-back-button/README.md +++ /dev/null @@ -1,117 +0,0 @@ -# @ngx-back-button -A library for handling a proper angular back button capability - -![NPM](https://img.shields.io/npm/l/ngx-back-button) -[![npm version](https://img.shields.io/npm/v/ngx-back-button.svg)](https://www.npmjs.com/package/ngx-back-button) -![npm bundle size](https://img.shields.io/bundlephobia/min/ngx-back-button) -![npm](https://img.shields.io/npm/dm/ngx-back-button) - -1. Handle Browser history -2. Handle `Fallback` when clicking on the back button when not routed yet -3. Handle custom `Fallback` - -## Demo -- https://stackblitz.com/~/github.com/rbalet/ngx-back-button - -## Installation - -```sh -npm install ngx-back-button -``` - -Inside your `app.module.ts` file. -```typescript -import { NgxBackButtonModule } from 'ngx-back-button' - - imports: [ - NgxBackButtonModule.forRoot({}), // Default rootUrl === '/' - - // Or - NgxBackButtonModule.forRoot({ - rootUrl: '/custom', // Or any custom root url - fallbackPrefix: '/tabs' // For libraries users - }), - ], -``` - -### rootUrl -The default fallback in case your landing on the page and have nothing to go back to - -### fallbackPrefix -Added to the fallback argument. - -Use: If you're building a library, wish to put some back button with fallback. - -Let say, you build a component that have the following -```html - -``` - -But inside your app, you always have the `/tabs` first. - -Adding `fallbackPrefix: '/tabs'` will be the same as if you were doing the following - -```html - -``` - -## Usage -Wherever you plan to use the back button logic - -```typescript -import { NgxBackButtonModule } from 'ngx-back-button' - -imports: [ - NgxBackButtonModule, -] -``` - -Then you can use it in two different way - -### Directive -Normal use -```html - -``` - -With Fallback -```html - -``` - -### Service -```typescript -// foo.component.ts -import { NgxBackButtonService } from 'ngx-back-button' - -// ... - constructor(public ngxBackButtonService: NgxBackButtonService) {} -``` - -Normal use -```html - -``` - -With Fallback -```html - -``` - -## Authors and acknowledgment -* maintainer [Raphaël Balet](https://github.com/rbalet) -* Inspired by [Nils Mehlhirn](https://nils-mehlhorn.de/posts/angular-navigate-back-previous-page/) - -[![BuyMeACoffee](https://www.buymeacoffee.com/assets/img/custom_images/purple_img.png)](https://www.buymeacoffee.com/widness)