Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ruslanguns/angular-pipe-unique-slug-generator
Angular Pipe Unique Slug Generator
https://github.com/ruslanguns/angular-pipe-unique-slug-generator
Last synced: 7 days ago
JSON representation
Angular Pipe Unique Slug Generator
- Host: GitHub
- URL: https://github.com/ruslanguns/angular-pipe-unique-slug-generator
- Owner: ruslanguns
- Created: 2020-09-14T00:25:42.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T08:41:45.000Z (11 months ago)
- Last Synced: 2024-05-28T17:06:16.312Z (6 months ago)
- Language: TypeScript
- Size: 128 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Angular Unique Slug Generator Pipe
This is an Angular repository with a playground of an Angular Pipe for generating slug from an string of characters, it supports English & Spanish Characters and also comes with unique slug options which makes sure you are generating an unique slug for your app.
>If you want to see a demo with all this code checkout my [demo on Stackblitz](https://stackblitz.com/edit/angular-slugify-pipe?file=src/app/slugify.pipe.ts)
## How to use it?
Just create a pipe like slugify.pipe.ts file which is right in the src/app directory. Maybe I realease a library with that tool, I'm not sure yet. Then just use it as the following e.g.:
```html
{{
content | slugify: {
unique: true,
uniqueOptions: {
randomLength: 6,
chars: ['lowercase', 'numeric'],
separator: '-'
}
}
}}
```The slugify itself does not generate an unique slug but if you enable the unique property then you will be shown with its default settings, if you would like to have custom settings then add uniqueOptions object (this is optional), setting up the randomLength, chars combination and the slug separator.
Before Pipe:
`¡Este artículo habla sobre Angular y sus slugs potentes!`
After Pipe:
`este-articulo-habla-sobre-angular-y-sus-slugs-potentes-dgaode`
## TODO
- [ ] Publish a npm library## Author
**Ruslan Gonzalez**
* Github: [Profile](https://github.com/ruslanguns)
* Website: [https://rusgunx.tk](https://rusgunx.tk)
* Twitter: [@ruslangonzalez](@ruslangonzalez)