..blabla How to get the link ...">

Get link to angular 4 element

I have a component that looks like this:

..blabla
 <img md-card-image src="..">
..blabla

How to get the link inside my .ts component so that I can change its src using angular 4?

+4
source share
1 answer

in HTML:

<img #img md-card-image src="..">

in TS:

@ViewChild('img') img: ElementRef;
+17
source

Source: https://habr.com/ru/post/1677020/


All Articles