angular-truncate-pipes

A collection of Angular Pipes

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
angular-truncate-pipes
000.0.74 years ago5 years agoMinified + gzip package size for angular-truncate-pipes in KB

Readme

angular-truncate-pipes
A collection of truncating pipes

Requirements

  • Angular >= 4.0.0

Installation

npm install angular-truncate-pipes --save
In your app.module.ts:
import { TruncatePipesModule } from 'angular-truncate-pipes';
@NgModule({
    ...
    imports: [TruncatePipesModule]
    ...
});

Background


Examples

<th>Pipe</th>
<th>Args</th>
<th>Result</th>
<tr>
  <td>characters</td>
  <td>5</td>
  <td>{{truncateWord | characters:5}}</td>
</tr>
<tr>
  <td>characters</td>
  <td>0</td>
  <td>{{truncateWord | characters:0}}</td>
</tr>
<tr>
  <td>characters</td>
  <td>10:true</td>
  <td>{{truncateWord | characters:10:true}}</td>
</tr>
<tr>
  <td>splitcharacters</td>
  <td>15</td>
  <td>{{truncateWord | splitcharacters:15}}</td>
</tr>
<tr>
  <td>splitcharacters</td>
  <td></td>
  <td>{{truncateWord | splitcharacters}}</td>
</tr>
<tr>
  <td>words</td>
  <td></td>
  <td>{{truncateWord | words}}</td>
</tr>
<tr>
  <td>words</td>
  <td>2</td>
  <td>{{truncateWord | words: 2}}</td>
</tr>

TODOS

  • Write test scripts

License

MIT