I'm trying to play sound from NavbarComponent:
audio = new Audio('../../../content/images/Ding-dong.mp3');
I can't get image as well:
ngOnInit() {
let myImage = new Image(100, 200);
myImage.src = '../../../content/images/image.png';
document.body.appendChild(myImage);
...
}
I always get error in console:
GET http://localhost:9000/content/images/image.png 404 (Not Found)
GET http://localhost:9000/content/images/Ding-dong.mp3 404 (Not Found)
No problem to get there from navbar.scss, like logo:
.logo-img {
height: 45px;
width: 70px;
display: inline-block;
vertical-align: middle;
background: url("../../../content/images/image.png") no-repeat center center;
background-size: contain;
}
How can I access to these files from .ts file?
JHipster 4. Angular 5.