-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<div> | ||
<p>You can use @Input to decorate a field making it accept values sent by the component props.</p> | ||
<p>For example:</p> | ||
<pre> | ||
export class TitleComponent {{ '{' }} | ||
@Input() | ||
message: string; | ||
{{ '}' }} | ||
</pre> | ||
|
||
<p>And then you can call the component passing a value for message.</p> | ||
<pre> | ||
<app-title message="Hello world" /> | ||
</pre> | ||
|
||
<app-title message="Hello world"></app-title> | ||
</div> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { InputComponent } from './input.component'; | ||
import { SharedModule } from '../../shared/shared.module'; | ||
|
||
describe('InputComponent', () => { | ||
let component: InputComponent; | ||
let fixture: ComponentFixture<InputComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ InputComponent ], | ||
imports: [SharedModule], | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(InputComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Component, Input } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-input', | ||
templateUrl: './input.component.html', | ||
styleUrls: ['./input.component.scss'] | ||
}) | ||
export class InputComponent { | ||
} |