15.md (1215B)
1 # #15 Linkify types not working 2 3 - **State:** closed 4 - **Author:** @MTRNord 5 - **Created:** 2018-03-27T14:03:36Z 6 - **Closed:** 2018-04-11T10:15:38Z 7 - **Labels:** bug, Blocked Upstream 8 - **Assignees:** @MTRNord 9 10 --- 11 12 Linkify isn't working because of these lines: https://github.com/SocialNetworkNews/SocialNetworkNews-Web/blob/dabfb2d71b1d72929be916ef95ba99d3f4cd8af2/src/app/tweet-list/tweet-list.component.ts#L15-L19 13 14 Upstream Issue is opened at: https://github.com/SoapBox/linkifyjs/issues/227 15 16 17 ## Comments 18 19 ### @nazarkryp — 2018-04-06T10:23:46Z 20 21 Actually works: 22 23 ``` 24 import * as linkify from 'linkifyjs'; 25 import * as linkifyStr from 'linkifyjs/string'; 26 import * as hashtag from 'linkifyjs/plugins/hashtag'; 27 import * as mention from 'linkifyjs/plugins/mention'; 28 29 @Pipe({ 30 name: 'linkify' 31 }) 32 export class LinkifyPipe implements PipeTransform { 33 constructor( 34 @Inject(DOCUMENT) dom: Document) { 35 hashtag(linkify); 36 mention(linkify); 37 } 38 39 public transform(text: any): string { 40 return linkifyStr(text); 41 } 42 } 43 ``` 44 45 ### @MTRNord — 2018-04-06T12:33:15Z 46 47 Reopenening for the purpose to track having to type linkifyjs. linkifyjs types are not correct and let the build fail 48