Skip to main content

Posts

Showing posts with the label Angular 4 Toggle

Angular 2 Authentications with Angular2-JWT

What is JWT? JWT is Stand for “ JSON Web Token ”. It is stateless Authentication in Angular Apps and Easily Angular apps are authenticated with JWT! Stayed Informed – 125 Best Angular 2 Interview Questions and Answers JWT Contain Three Parts - 1.      Header – Is used to define the algorithm to sign the token and token type. 2.      Payload – It is used to keep a JSON object of all the claims which you want. 3.      Signature - It is secret key and used to verify the Signature! JWT Key Features - 1.      Decode a JWT from your Angular app and read its payload 2.      Attach the JWT as an Authorization header to XHR requests 3.      Existing service method (logging in and logging out) are used to checks whether the current user's JWT is expired or not. JWT Installation from NPM - > npm install angular2 - jwt Applicatio...

Angular 4 Show Hide Elements | Angular 4 Toggle

Hello guys, I am going to share toggle menu using angular 4. I have two components. 1-       Header Layout and 2-       Second one is for Menu List. I have written a toggle function on click of icon in the header layout and I am trying to show and hide to menu items. Stayed Informed   –  Angular 2 if then else examples Example as, import { Component } from '@angular/core' ; @Component ({ selector: 'navbar' , templateUrl: '/app/myComponent.html' }) export class myComponent { menulist: boolean = false; logo = '/images/logo.png' ; toggleMenu(): void { this . menuItem = ! this . menuItem; } } //app-menu.html <div class= "menues" > <ul * ngIf= "!menuItem" > <li * ngFor= "let menu of menus" > <a href= "{{menu.href}}" class= "menulink" > {{menu.menuName}} </a> </li> </ul...