You have unlimited access as a PRO member
You are receiving a free preview of 3 lessons
Your free preview as expired - please upgrade to PRO
Contents
Recent Posts
- Object Oriented Programming With TypeScript
- Angular Elements Advanced Techniques
- TypeScript - the Basics
- The Real State of JavaScript 2018
- Cloud Scheduler for Firebase Functions
- Testing Firestore Security Rules With the Emulator
- How to Use Git and Github
- Infinite Virtual Scroll With the Angular CDK
- Build a Group Chat With Firestore
- Async Await Pro Tips
Angular Pipe to Shuffle Strings With JavaScript
written by Jeff DelaneyIn this quick snippet, I provide code to randomly shuffle a string with JavaScript. It works by breaking down the string into an array, shuffling it, then joining it back together. This might be useful for hiding content or anonymizing data.
You could also use the lodash shuffle
operator to replace the randomize
function defined below.
shuffle.pipe.ts
import { Pipe, PipeTransform } from '@angular/core'; |
foo.component.html
<div *ngFor="let user of users | async"> |