Skip to content

Instantly share code, notes, and snippets.

View kevinchisholm's full-sized avatar

Kevin Chisholm kevinchisholm

View GitHub Profile
<p>The Parent Component is the AppComponent</p>
<app-first-child></app-first-child>
<p>The Child Component is MyFirstComponent</p>
<p>The Parent Component is the AppComponent</p>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { MyFirstComponent } from './my-first.component';
@NgModule({
declarations: [
AppComponent,
MyFirstComponent
import { Component } from '@angular/core';
@Component({
selector: 'app-first-child',
templateUrl: './my-first.component.html',
styleUrls: ['./my-first.component.css']
})
export class MyFirstComponent {
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>MyFirstAngularApplication</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>MyFirstAngularApplication</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'my-first-angular-application';
}
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'my-first-angular-application';