Signup and Sign in Angular 6 Using API With Sample Code

Login and Registration is the most important feature on the web site or web apps. Nowadays developers are using UI as angular. Angular is very robust and javascript based open source framework, which helps to develop a high volume apps and website. It can be implemented with all another angular like PHP, .Net Java. Here I reached so many blogs, people’s need basically log in and registration with API.So I made a blog with using angular6 and PHP API. You can use any kind of API as per your development environment. Before starting this tutorial I will give a brief explanation about API.

Now We have to create a database in phpmyadmin called a demo. Then we need to create a table called users, where the user information is going to store. download below 2 PHP files put into your htdocs (xammp) or www (wamp) folder in the local machine.

Now download the given script files and put in your local machine and npm install then ng sever -o

angular 6 registration and login API with PHP

 

DATABASE-

Step-1

Step-2

PHP Login API- login.php

Step-3:

Registration API – Registration.php

Step-4

Download Sample Code

Download the source code

 

 

Step-5:

Goto auth.services.ts  and change the following URL as per your API path;

After following the above procedure, If you are facing any doubt then feel free to ping in below message box, I will reach out with solutions.