Nav
Nav

Reputation: 111

What should I do if I get an error that template is not specified for this component in angular 4?

Actually I change My component in angular and now it showing an error that I am not specified any template for this component. My Controller name is Login.component.ts and Code is

import { Component } from '@angular/core';

@Component({
    selector: 'app-Login',
   // templateUrl:"Login.components.html"
    template:"hello"

})
export class LoginComponent  {


}

Upvotes: 0

Views: 861

Answers (1)

Rahul Purohit
Rahul Purohit

Reputation: 585

Check these steps with me : 1. Add the new component name in the app.module.ts

import { LoginComponent } from './login.component';
  1. Make sure there isn't a typo in the template url here. I think it should be somewhat like:

    templateUrl:"./login.components.html",

Change the urls according to you directory structure.

Upvotes: 1

Related Questions