A collection of truncating pipes
- Angular >= 4.0.0
npm install angular-truncate-pipes --save
In your app.module.ts:
import { TruncatePipesModule } from 'angular-truncate-pipes';
@NgModule({
...
imports: [TruncatePipesModule]
...
});
-
The count-to code was re-written from this AngularJS module
-
The package build is from robisim74's angular-library-starter
Pipe | Args | Result |
---|---|---|
characters | 5 | {{truncateWord | characters:5}} |
characters | 0 | {{truncateWord | characters:0}} |
characters | 10:true | {{truncateWord | characters:10:true}} |
splitcharacters | 15 | {{truncateWord | splitcharacters:15}} |
splitcharacters | {{truncateWord | splitcharacters}} | |
words | {{truncateWord | words}} | |
words | 2 | {{truncateWord | words: 2}} |
- Write test scripts
MIT