Lars.J
Lars.J

Reputation: 1

Loading image issue in Edge

I have a site that displays a image of the current user. The site uses Angularjs frontend and c# backend. This works fine using IE11, firefox and Opera, but in edge it cant seem to find the image. My html:

<img ng-src="{{getImgUrl('@User.Identity.Name')}}" class="headshot" />

Method in controller:

$scope.getImgUrl = function (username) {
        var outputURL = "https://myurl.com/profilepictures/" + username + "_LThumb.jpg";
        return outputURL;
    };

Style:

.headshot {
padding-top: 10px;
padding-bottom: 10px;
}

Upvotes: 0

Views: 569

Answers (2)

Lars.J
Lars.J

Reputation: 1

I think I figured this out. The app is an intranet app, and the problem was mixing the intra/inter -net. It resolved itself when I launched the app. For more info se: SEC7117 Error when trying to load a javascript file in MS Edge

Upvotes: 0

Martin Beeby
Martin Beeby

Reputation: 4599

In the getImgUrl function you seem to be referencing $scope.usernam (missing an e) This looks like a mistake also I'd have guessed you would want to be referencing the username that is passed to the function rather than a variable from the scope e.g::

$scope.getImgUrl = function (username) {
    var outputURL = "https://myurl.com/profilepictures/" + username + "_LThumb.jpg";
    return outputURL;
};

Upvotes: 1

Related Questions