I have a json file contains a icons object like this:
"icons" : {
"logo" : "fa fa-caret-down",
"search" : "fas fa-search",
"bell" : "far fa-bell"
}
In my component.ts, I am able to get this icons object using a service successfully like this:
navIcons: object;
getNavIcons(): void {
this.navbarService.getNavIcons()
.subscribe(navIcons => {
this.navIcons = navIcons;
console.log(this.navIcons)
// icons : {
// logo : "fa fa-caret-down",
// search : "fas fa-search",
// bell : "far fa-bell"
// }
});
}
How can I bind thoes class in the component.html template? I tried like this:
but it failed. I also have another calss: nav-icon need to added into this logo? Thank you in advanced!
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)