A
A
Angularity2017-03-20 23:15:45
Angular
Angularity, 2017-03-20 23:15:45

Why is the image from the web not displayed in Angular2?

Assigned a link to the image to the variable.

imageUrl = 'https://angular.io/resources/images/logos/angular2/angular.png';

In template
<img [src]="imageUrl"
<img src="{{ imageUrl }}"
<img src="https://angular.io/resources/images/logos/angular2/angular.png"

The code was written not in app.component.html, but in app.component.ts (template).
None of the options work.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SergeyBugai, 2017-03-20
@SergeyBugai

A banal question, are you creating a variable in the same component? Are you creating via this (this.imageUrl) ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question