@Component({
selector: 'bancaComponent',
templateUrl: '{{str}}'
})
export class BancaComponent implements OnInit {
str: String;
constructor(private http: Http) { }
ngOnInit(): void {
this.str = "./file.component.html";
}
Is there another way to make it ? Thanks :)
Try this solution :
Inspired from : Angular 2/4 component with dynamic template or templateUrl
Official source : https://angular.io/guide/dynamic-component-loader