Skip to content

Angular 19, Resource Api and Signals #574

@AlanGRutter

Description

@AlanGRutter

I'm using a backend service to retrieve the contents of a markdown file from Azure Blob Storage. In my Angular application I use the new Resource Api to fetch this data

 markdownResource = resource({
    request: () => ({id: this.fileId()}),
    loader: async ({request}) => {
      const response = await fetch(`${this.baseUrl}/${request.id}`);
      if (!response.ok)
        throw new Error('Failed to fetch LMS content');

      return await response.text();
    }
  })

I am using the [data] property to bind the results

[data]="markdownResource.value()"

however the markdown is not being processed and simply renders the file contents inside quotation marks.

Is this supposed to work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions