This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Pipe, PipeTransform } from '@angular/core'; | |
| /* | |
| * Show total reading time for an text | |
| * Takes an input parameter text. | |
| * Usage: | |
| * value | readingtime | |
| * Example: | |
| * {{ This is a content of my blog post | readingtime }} min read. | |
| * formats to: 1 min read. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Pipe, PipeTransform } from '@angular/core'; | |
| /* | |
| * Strips HTM | |
| * Takes an input parameter HTML. | |
| * Usage: | |
| * content | striphtml | |
| * Example: | |
| * <p [innerHTML]="content | striphtml"></p> | |
| */ | |
| @Pipe({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Pipe, PipeTransform } from '@angular/core'; | |
| /* | |
| * Truncates an text with defined cut off length | |
| * Takes an input parameter string. | |
| * Usage: | |
| * string | truncatetext: 100 | |
| * Example: | |
| * <p>{{ string | truncatetext: 100 }}></p> | |
| */ | |
| @Pipe({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Pipe, PipeTransform } from '@angular/core'; | |
| import { | |
| DomSanitizer, | |
| SafeHtml, | |
| SafeStyle, | |
| SafeScript, | |
| SafeUrl, | |
| SafeResourceUrl | |
| } from '@angular/platform-browser'; | |
| /* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Injectable } from '@angular/core'; | |
| import { Title } from '@angular/platform-browser'; | |
| import { Router, NavigationEnd, ActivatedRoute } from '@angular/router'; | |
| import { filter, map, mergeMap } from 'rxjs/operators'; | |
| /** | |
| * Call updateTitle() from app.component.ts contructor. | |
| * Example app.component.ts: | |
| constructor(private meta: MetaService) { | |
| this.meta.updateTitle(); |