[Solved] Angular 4 adding an image before each new line using renderer

this.tooltip = this.renderer.createElement(‘div’); this.tooltipTitle.split(‘,’).forEach((text) => { this.renderer.appendChild(this.tooltip, this.renderer.createText(text)); this.renderer.appendChild(this.tooltip, this.renderer.createElement(‘br’)); var img2 = document.createElement(‘img’); // Use DOM HTMLImageElement img2.src=”https://stackoverflow.com/questions/54232501/image2.jpg”; img2.alt=”alt text”; this.renderer.appendChild(this.tooltip,img2); this.renderer.appendChild(this.tooltip, this.renderer.createElement(‘br’)); this.renderer.appendChild(document.body, this.tooltip); }); Another layout 5 solved Angular 4 adding an image before each new line using renderer

[Solved] Angular 4 adding an image before each new line using renderer

Angular 4 is a powerful and popular JavaScript framework used for developing web applications. It provides a wide range of features and tools to help developers create dynamic and interactive web applications. One of the features of Angular 4 is the ability to add an image before each new line using the Renderer class. This … Read more