This file contains 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 { AfterViewInit, Directive, ElementRef, Input, Renderer2 } from '@angular/core'; | |
@Directive({ | |
selector: '[appReadMore]' | |
}) | |
export class ReadMoreDirective implements AfterViewInit { | |
@Input() limit : number = 50; //to get the custom text limit | |
@Input() toggle : boolean = false; //true: 'Read Less' button will be present | |
txtSpan! : HTMLSpanElement; |
This file contains 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 { AfterViewInit, Directive } from '@angular/core'; | |
@Directive({ | |
selector: '[appReadMore]' | |
}) | |
export class ReadMoreDirective implements AfterViewInit { | |
constructor() { } | |
ngAfterViewInit(): void { |
This file contains 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 { Directive } from '@angular/core'; | |
@Directive({ | |
selector: '[appReadMore]' | |
}) | |
export class ReadMoreDirective { | |
constructor() { } | |
} |