-1

I use wordpress api for my angular project and in API has "" in API address like this :

<img src="{{importantvideo.better_featured_image.media_details.sizes.["covernews-medium"].source_url}}" class="has-border-bottom width-100pct">

And HTML does not recognize this and I get the error how can use API like this in my angular project

this is my property path

[0].better_featured_image.media_details.sizes["covernews-medium"] 
R. Richards
  • 24,603
  • 10
  • 64
  • 64

1 Answers1

1

You can use single quotes as well:

<img src="{{importantvideo.better_featured_image.media_details.sizes.['covernews-medium'].source_url}}" class="has-border-bottom width-100pct">

When should I use double or single quotes in JavaScript?

mrak
  • 2,826
  • 21
  • 21
  • Could you give some more details? At least the syntax should be valid by now. Maybe one of the properties is undefined (importantvideo, better_featured_image, sizes, ...)? – mrak May 16 '21 at 23:16