Skip to content

Nhipster blob entity generator issue front angular #201

Description

@Toysurusse
Overview of the issue

How to fix Blob front Angular view issue ?

Motivation for or Use Case

When you use nhipster entity generator with an angular front. Angular can't render the image of the blob after beeing storage in database.

Reproduce the error

use nhipster entity generator and you will have issue to view blob from backend.

Suggest a Fix

when the service nest get the blob image from the server, the image is convert in an buffer of hexadecimal. So I had to fix the service to add a converter hexaToString like the following function :
const blob = roadMap.image.toString('hex');
var result = '';
for (var i = 0; i < blob.length; i = i + 2) {
var decval = parseInt(blob.substr(i, 2), 16);
result = result + String.fromCharCode(decval);
}

JHipster Version(s)

last version

JHipster configuration

nhipster

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions