I am doing angular 4 project and i am new in angular 4. I want to set multiple template in my front website. For Example I have 4 theme in my admin panel and user login and set theme no. 2 for front website so theme no 2 active on his website.
I had an idea that if i can dynamic "templateUrl" so I can do such kind if job but i don't know how to do this.
Example Code:
@Component({
selector: 'app-products',
templateUrl: './products.component.html', // dymanic html file
styleUrls: ['./products.component.css']
})
export class ProductsComponent implements OnInit {
constructor() { }
public templateUrl:string;
ngOnInit() {
this.templateUrl = './products.component.html';
}
}
Thanks In Advance.