Skip to main content

Posts

Showing posts with the label Angular 4 vs. Angular 2

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...

How To Setup Angular 2 in Visual Studio 2017 MVC 5 / 6?

How To Building Angular 2 Apps using Visual Studio 2017 and MVC 6? This post helps us to learn how to Setup and Create an Application that Uses  Angular 2  for the client side and ASP.NET Core with single page application (SPA) for the server application. Open Command Prompt  and Follow the below mention Steps. Note - In the below steps,  Viainda  is a user in my machine. So that your end, you will see you or your user in your machine. Steps 1- C:\Users\Viainda> Steps 2- C:\Users\Viainda>F: Steps 3- F:\> Steps 4- F:\>mkdir Ng2DemoApp Steps 5- F:\>cd Ng2DemoApp Steps 6- F:\Ng2DemoApp>node --version v7. 1.0 Steps 7- F:\Ng2DemoApp>dotnet new --install Microsoft.AspNetCore.SpaTemplates::* Restoring packages for C: \ Users \ Viainda \ .templateengine \ dotnetcli \ v1. 0.3 \ scratch \ restore.csproj... Installing System.Xml.XPath 4.0 . 1. Installing runtime.native.System.IO.Comp...

Angular 4 If Else and Then Conditions [7 Best Examples]

The “ If ” evaluates expression and then renders the “ else ” or “ then ” template in its place when expression is “truthy” or “falsy” respectively. Stayed Informed –  Angular 4 vs. Angular 2 Stayed Informed –  Angular 2 if else examples Then : - This template is the inline template of “ If ” unless bound to a different value. Else : - This template is blank unless it is bound. Selectors : - 1.       If 2.       If then 3.       If else The multiple examples for Angular 4 if else and then as given bellows, Syntax:- <element * ngIf= "[condition expression]; else [else template]" > </element> Syntax:- <div * ngIf= "users | async; else loadingGrid; let user" > <p> {{user.Id}} </p> <p> {{user.name}} </p> <p> {{user.Age}} </p> </div> <ng -template # loadingGrid > loading... < /ng-templ...