From 3a64f4aaabb1660f6a758a89aadd9a5df6082661 Mon Sep 17 00:00:00 2001 From: LucaBiondo Date: Tue, 9 Apr 2019 17:50:21 +0200 Subject: [PATCH] Fromo mySuccessMethod to myExecuteSubmitMethod (#4573) In the tutorial, when working with events, it says that we want to show an allert when submitting the login form but in the code just below it binds the allert to the "success" event and not to the "executeSubmit" event. Also calls the method mySuccessMethod and not myExecuteSubmitMethod as it does at the very and of the Tutorial. So i made the appropriate changes to adjust the code and the tutorial to show how to properly bind an allert to the "eventSubmit" event. Regards Luca Biondo --- docs/tutorials/using-components.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/tutorials/using-components.md b/docs/tutorials/using-components.md index 705b318832..0ac5e73cb9 100644 --- a/docs/tutorials/using-components.md +++ b/docs/tutorials/using-components.md @@ -73,23 +73,23 @@ docs, we can see that it emits three events: `success`, `error` and `executeSubm We can subscribe to these events and have our custom code executed when these events are emitted. Let's hook into the `executeSubmit` and do a simple `alert()` when the form is submitted. -Open `src/app/login/login.component.html` and add `(success)="mySuccessMethod($event)"` to the `` component: +Open `src/app/login/login.component.html` and add `(executeSubmit)="myExecuteSubmitMethod($event)"` to the `` component: ```html ``` -Next we need to implement `mySuccessMethod` in the typescript. Open `src/app/login/login.component.ts` and add a new method: +Next we need to implement `myExecuteSubmitMethod` in the typescript. Open `src/app/login/login.component.ts` and add a new method: ```ts // Add this! -mySuccessMethod(event: any) { +myExecuteSubmitMethod(event: any) { alert('Form was submitted!'); console.log(event); } @@ -108,7 +108,7 @@ import { Component } from '@angular/core'; export class LoginComponent { // Add this! - mySuccessMethod(event: any) { + myExecuteSubmitMethod(event: any) { alert('Form was submitted!'); console.log(event); }