import { Component } from '@angular/core';
import { environment } from '../environments/environment';
const template = environment.production ? '../dev/dev-app.component.html' : './app.component.html';
@Component({
selector: 'app-root',
templateUrl: template,
styleUrls: ['./app.component.scss']
})
export class AppComponent {
title = 'app';
}
In the above I am trying to write a conditional variable called template
which will load the view for the component.
Only I'm getting the following error:
ERROR in ./src/app/app.component.ts
Module not found: Error: Can't resolve ' template' in '/src/app'