Reputation: 567
In new installed Angular I changed
app.components.ts file like this
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: `<h1>Some Information</h1>`,
})
export class AppComponent {
title = 'my-app';
}
But after compiling I am getting error
ERROR in ./src/app/app.component.ts Module not found: Error: Can't resolve
My app directory contains only two files app.component.ts and app.module.ts
Where is the problem ?
What is a right way to create component with inline template ?
Upvotes: 1
Views: 2897
Reputation: 19933
One issue that I see in your code is using templateUrl
while you are providing the actual template
so instead of templateUrl
use template
Upvotes: 2