O'Reilly logo

Rails, Angular, Postgres, and Bootstrap, 2nd Edition by David B. Copeland

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Listening for User Change Events

We now have everything in place to allow the user to edit data in our Angular app, including validations and user feedback using Bootstrap. Now, we need to save that data back to the server whenever it changes.

We could certainly add a button to CustomerDetailsComponent, add a click handler to it, and do an Ajax POST to the server with the customer data. But, in the interest of learning something we don’t already know, let’s design the app so that whenever the user tabs off of a control, that change is saved back to the server automatically. This allows us to take a look at a new way components can communicate: event emitters.

Communicate Between Parent and Child Components with Event Emitters

You’ve seen ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required