In my case, i wanted to use two different html templates with different css frameworks. Bulma and bootstrap. Just for testing purposes. I switched the templates based on the environment variable.
In environment file export const environment = { useBulma: true }; and in component import { environment } from 'src/environments/environment'; @Component({ selector: 'app-test', templateUrl: environment.useBulma ? './with-bulma.component.html' : './with-bootstrap.component.html', styleUrls: ['./value.component.css'] }) On Tuesday, 12 January 2016 05:57:39 UTC+5, Long Field wrote: > > Have try a lot, couldn't find out how to do this: templateUrl dynamically > from a variable/property, [Url], {{URL}}, "[Url]", "{{Url}}", none of them > work > > @Component({ > templateUrl: Url > }) > export class App { > public Url = "app/about.html"; > } > > -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/angular/6b073e00-993a-43da-ba63-216d3d869771%40googlegroups.com.