I think you could try this:
<div [ngStyle]="{'background-image': 'url(' + photo + ')'}"></div>
From reading your ngStyle
expression, I guess that you missed some “‘”…
More Related Contents:
- JS hide function error
- How to read with JavaScript [closed]
- Get the longest text in HTML document using Jquery or javascript
- How to implement something like this GIF that using mouse drag and select items
- Javascript counting all the characters from a HTML document
- Set cookie and get cookie with JavaScript [duplicate]
- Load and execution sequence of a web page?
- Check if an element contains a class in JavaScript?
- Disabling browser print options (headers, footers, margins) from page?
- JSFiddle code not working in my own page
- All About…. Z-Index?
- How to disable scroll without hiding it?
- jQuery: Get selected element tag name
- Why my show hide button needs double-click on first time
- How to dynamically create ‘@-Keyframe’ CSS animations?
- Infinity Loop Slider Concepts
- Make anchor link go some pixels above where it’s linked to
- Where should I put the CSS and Javascript code in an HTML webpage?
- jQuery jump or scroll to certain position, div or target on the page from button onclick [duplicate]
- jQuery vs document.querySelectorAll
- jQuery Validation using the class instead of the name value
- Center flex item in container, when surrounded by other flex items
- Change the style of :before and :after pseudo-elements? [duplicate]
- How to create checkbox inside dropdown?
- Safe value must use [property]=binding after bypass security with DomSanitizer
- Javascript-Setting background image of a DIV via a function and function parameter
- Gaussian Blur onHover Using jQuery
- how to use html2canvas and jspdf to export to pdf in a proper and simple way
- HTML5 Video duration without playing video
- How to get element by class name