Angular Ionic Side Menu With Authentication

September 08, 2019
Angular Ionic Side Menu With Authentication

In this post, we show you how to create an Angular Ionic side menu that displays different items based on role Users. we will create simple authentication mechanisms and how to display two different menus and two different user roles.


Step-1. Firstly We install the ionic project with the help of the ionic installation command.

Step-2.After creating an ionic project then open the command window then create some pages with the help of the command.

Step-3. After Create Pages go to app.module.ts File then add some library and Import.



Step-4. In this step go to providers/auth/auth.ts folder then open auth.ts file then copy-paste this code.

Step-5. In this step go to the pages folder then login/login.ts open login.ts file write this code.

Step-6. In this step go to pages folder then login/login.html open login.html file write copy-paste code.


 
Step-7. After the Finished login part move to the menu, the part goes to the menu folder then the menu.ts file opens the file and copy-paste code.


Step-7. After complete, the menu.ts file move to the menu.html file open file then writes code.






Step-8. After the Complete Menu, part goes to the admin/admin.html file then writes a code.




Step-9. Open adminSecond/adminSecond.html file then write code.


Step-10. Open User/User.html file then write code.



Step-11. Open UserSecond/UserSecond.html file then write code.