Skip to content
Prev Previous commit
Next Next commit
Generate top bar component
This is what's created by `ng generate` except for the HTML, which we modified to say "My Store" in an `h1` header. Co-authored-by: KK Lamberty <lamberty@morris.umn.edu>
  • Loading branch information
NicMcPhee and kklamberty committed Jun 19, 2020
commit 35ff8b2dead2b71bf08719429d6e07d4c341d096
4 changes: 3 additions & 1 deletion phone-store/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import { NgModule } from '@angular/core';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { TopBarComponent } from './top-bar/top-bar.component';

@NgModule({
declarations: [
AppComponent
AppComponent,
TopBarComponent
],
imports: [
BrowserModule,
Expand Down
1 change: 1 addition & 0 deletions phone-store/src/app/top-bar/top-bar.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>My Store</h1>
Empty file.
25 changes: 25 additions & 0 deletions phone-store/src/app/top-bar/top-bar.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { TopBarComponent } from './top-bar.component';

describe('TopBarComponent', () => {
let component: TopBarComponent;
let fixture: ComponentFixture<TopBarComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ TopBarComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(TopBarComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
15 changes: 15 additions & 0 deletions phone-store/src/app/top-bar/top-bar.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'app-top-bar',
templateUrl: './top-bar.component.html',
styleUrls: ['./top-bar.component.scss']
})
export class TopBarComponent implements OnInit {

constructor() { }

ngOnInit(): void {
}

}