Permalink
Browse files

建立 hello-world component

  • Loading branch information...
1 parent af87ed8 commit fbaf4864f3f7b265dd2a2e1793ba356ceb91bee9 Sam.IO.Hsiao committed Nov 15, 2016
@@ -4,10 +4,12 @@ import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { AppComponent } from './app.component';
+import { HelloWorldComponent } from './hello-world/hello-world.component';
@NgModule({
declarations: [
- AppComponent
+ AppComponent,
+ HelloWorldComponent
],
imports: [
BrowserModule,
@@ -0,0 +1,3 @@
+<p>
+ hello-world works!
+</p>
@@ -0,0 +1,28 @@
+/* tslint:disable:no-unused-variable */
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { By } from '@angular/platform-browser';
+import { DebugElement } from '@angular/core';
+
+import { HelloWorldComponent } from './hello-world.component';
+
+describe('HelloWorldComponent', () => {
+ let component: HelloWorldComponent;
+ let fixture: ComponentFixture<HelloWorldComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ HelloWorldComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(HelloWorldComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-hello-world',
+ templateUrl: './hello-world.component.html',
+ styleUrls: ['./hello-world.component.css']
+})
+
+export class HelloWorldComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit() {
+ }
+}

0 comments on commit fbaf486

Please sign in to comment.