17.10.2018 Views

Angular

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

selector: 'child-component',<br />

templateUrl: './child-component.html',<br />

styles: [`<br />

.btn {<br />

height: 30px;<br />

width: 100px;<br />

border: 1px solid rgba(0, 0, 0, 0.33);<br />

border-radius: 3px;<br />

margin-bottom: 5px;<br />

}<br />

`]<br />

})<br />

export class ChildComponent{<br />

@Input() usersDetails : Array = null;<br />

@Output() changeUsersActivation = new EventEmitter();<br />

}<br />

triggerEvent(user : User){<br />

this.changeUsersActivation.emit(user);<br />

}<br />

child HTML :<br />

<br />

<br />

<br />

<br />

<br />

Name<br />

<br />

<br />

<br />

<br />

<br />

{{user.firstName}}<br />

{{user.active}}<br />

<br />

<br />

<br />

<br />

<br />

GoalKicker.com – <strong>Angular</strong> 2 Notes for Professionals 176

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!