Building a custom module for global notification
As you might have realized by now, our login page works fine as long as we put the correct credentials; however, when you try with an invalid username or password, the page doesn't do anything.
Tip
The developer console should, however, show a 401 Unauthorized failed message.
We will need to build a notification system that displays a message when invalid credentials are passed. Thinking a few steps ahead, you'll realize that we are going to need such messages displayed on many occasions, for example, when a new page has been created or updated, or when a page has been deleted.
In view of this, it is most ideal to build a global notification system that can be used all throughout our application.
AngularJS allows us to create custom modules. These are self-contained modules that can be easily reused across multiple applications. A custom module is simply a wrapper that holds different parts of an AngularJS app; these parts can be directives, services...