Skip to content

Commit

Permalink
Add Title component with @input decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
brunolm committed Nov 24, 2017
1 parent 961248c commit 6261d26
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/shared/title/title.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div>
<h2>{{ message }}</h2>
<hr />
</div>
Empty file.
25 changes: 25 additions & 0 deletions src/app/shared/title/title.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 { TitleComponent } from './title.component';

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

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

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

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

@Component({
selector: 'app-title',
templateUrl: './title.component.html',
styleUrls: ['./title.component.scss']
})
export class TitleComponent {
@Input()
message: string;
}

0 comments on commit 6261d26

Please sign in to comment.