Getting ready

Let's create a current user service to manage the current user in our application. To start with, we can use this service to do basic things for us, such as giving us the full name of the user when they create new blog posts. Going forward, we could expand this service to also handle user authentication as well, so only authorized users will be able to create blog posts in our application.

Before we get started, we will generate a new current user service using Angular-CLI. We will also need a new class that will act as our user model, so we will generate that as well:

ng generate service current-user
ng generate class user
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.89.183