I am trying to implement some PDF Viewer ngx-extended-pdf-viewer
The sample code provided by the developer of the custom component to read a Base64 string and load in viewer is like the snippet below. When i use the code below i get the following error
Type 'string' is not assignable to type 'Subject'
Not sure what causes and fix it.
export class Base64Component {
public base64 = new Subject<string>();
constructor(private httpClient: HttpClient) {}
public ngOnInit(): void {
this.httpClient.get(
'/assets/pdfs/Bootstrap-vs-Material-Design-vs-Prime-vs-Tailwind.base64.txt',
{ responseType: 'text' as 'json' })
.pipe(
tap((base64) => (this.base64. = base64 as string)),
).subscribe();
}
