I've been working on creating a custom pipe similar to the code below:
@Pipe({
name: 'imagePipe'
})
@Injectable()
export class ImagePipe {
constructor(public someService: SomeService, public storage: Storage) {
}
transform(value: any, arg: any) {
if ((value != null) && (value!=arg)){
return this.storage.get(value).then((val) => {
console.log('Your source is', val);
})
}
}
}
The main purpose of this pipe is to look for a specific value in storage and then set the URL for an image. I'm using it like this:
<img src="{{info.title | imagePipe : otherTitle | async}}" width="45" height="120"/>
Although the console displays the correct value, unfortunately, the image URL remains null.