Skip to content

How to Add a New Component #5

@skeshive

Description

@skeshive
  1. my-app --> src --> app --> components --> CREATE NEW FOLDER with .ts, .html, and .css files
  2. In the .ts file add (change header to name of component)
import { Component } from '@angular/core';

@Component({
  selector:'header',
  templateUrl:'./header.component.html',
  styleUrls: ['header.component.css']
})

export class HeaderComponent { }
  1. my-app --> src --> app --> app.module.ts --> IMPORT component and ADD declaration
  2. my-app --> src --> app --> app.component.html --> ADD selector tag so HTML shows up on main page

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions