I am trying to use a pipe inside a foreach loop in my angular component. My array is populated and so is each item of the array when I debug it
console.log(this.blog);
this.relatedLinks = this.blog.related;
this.relatedLinks.forEach(function (link) {
this.newlink = this.removeSpace.transform(link);
this.relatedBlogList = this.Blogs.filter(blog => blog.title === this.newlink);
});
},
But while applying the pipe I get the following error: ERROR TypeError: Cannot read property 'removeSpace' of undefined.