Building an Ajax button component

When we save/update an exercise or workout, there is always the possibility of duplicate submission (or duplicate POST requests). The current implementation does not provide any feedback as to when the save/update operation started and when it is  completed. The user of an app can knowingly or unknowingly click on the Save button multiple times due to the lack of visual clues.

Let's try to solve this problem by creating a specialized button—an Ajax button that gives some visual clues when clicked on and also stops duplicate Ajax submissions.

The button component will work on these lines. It takes a function as input. This input function (input parameter) should return a promise pertaining to the remote request. ...

Get Building Large-Scale Web Applications with Angular now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.