Skip to content

Commit

Permalink
ch02 - new component my-list: ng g c my-list
Browse files Browse the repository at this point in the history
  • Loading branch information
taitruong committed Feb 11, 2019
1 parent 8e17507 commit 5ec3abb
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Cheatsheet02Component/src/app/app.module.ts
Expand Up @@ -2,10 +2,12 @@ import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import { MyListComponent } from './my-list/my-list.component';

@NgModule({
declarations: [
AppComponent
AppComponent,
MyListComponent
],
imports: [
BrowserModule
Expand Down
3 changes: 3 additions & 0 deletions Cheatsheet02Component/src/app/my-list/my-list.component.html
@@ -0,0 +1,3 @@
<p>
my-list works!
</p>
25 changes: 25 additions & 0 deletions Cheatsheet02Component/src/app/my-list/my-list.component.spec.ts
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { MyListComponent } from './my-list.component';

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

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

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

it('should create', () => {
expect(component).toBeTruthy();
});
});
15 changes: 15 additions & 0 deletions Cheatsheet02Component/src/app/my-list/my-list.component.ts
@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'tai-my-list',
templateUrl: './my-list.component.html',
styles: []
})
export class MyListComponent implements OnInit {

constructor() { }

ngOnInit() {
}

}

0 comments on commit 5ec3abb

Please sign in to comment.