ng-click and ng-if in Angular2 (click and *ngIf)

  • First we need to create a function that sets currentPerson to the person clicked, we add this function in our component.ts file (previously repeater.ts).
  • We’re going to continue with the project from my previous post .
  • No rocket science we set currentPerson to the person passed to our function and do nothing when we click the same person twice.

Read the full article, click here.


@JavaScriptKicks: “ng-click and ng-if in Angular2 (click and *ngIf) by @Jilles #javascript #angularjs via @JavaScriptKicks”



ng-click and ng-if in Angular2 (click and *ngIf)

You might also like More from author

Comments are closed, but trackbacks and pingbacks are open.