AngularJS 6 – ADAL Authentication

Today i want to talk to you about Microsoft ADAL (Azure Active Directory Authentication Library).
ADAL allows users to authenticate in Active Directory (AD) local or in the cloud and take token to protect the API.

How can i do to integrate it in a AngularJS 6 app?

1) Install the js library microsoft-adal-angular6

2) Open app.component.ts
2.1) Import the microsoft adal

2.2) In the export class AppComponent change the constructor

3) Open app.module.ts
3.1) Import the microsoft adal

3.2) We must to change our routes

3.3) In NgModule import library

If you want an example AngularJS 6 ADAL App click here.

AngularJS 6 Material – MatDatePicker italian format dd/MM/yyyy

Material Angular is very very useful library to generate beautiful app with material design and use all the power of angular.
Today we can see how to set the format for the MatDatePicker with dd/MM/yyyy so how to customize it, then you can change it.

In our Angular 6 project we must to install moment.
So execute in our project directory:

Then we must to open our
app.module.ts

At the end all the date in our project became with the format dd/mm/yyyy!!
Some question contact me.

Angular 6 – IE 11 method fill not supported

You have created your angular app and now you have some error about method fill, for example: “Object doesn’t support property or method ‘fill'”.
Line that fail: var HEADER_FILLER = new Array(HEADER_OFFSET).fill(null); (Angular core).

Don’t worry the solution is easy. You must open your file on: src/polyfill.ts
At line 21 of the file you see:

/** IE9, IE10 and IE11 requires all of the following polyfills. **/

and many “import ‘core-js/es6/BLABLA’” commented.

You must to uncomment all:

<br />
/** IE9, IE10 and IE11 requires all of the following polyfills. **/<br />
import 'core-js/es6/symbol';<br />
import 'core-js/es6/object';<br />
import 'core-js/es6/function';<br />
import 'core-js/es6/parse-int';<br />
import 'core-js/es6/parse-float';<br />
import 'core-js/es6/number';<br />
import 'core-js/es6/math';<br />
import 'core-js/es6/string';<br />
import 'core-js/es6/date';<br />
import 'core-js/es6/array';<br />
import 'core-js/es6/regexp';<br />
import 'core-js/es6/map';<br />
import 'core-js/es6/weak-map';<br />
import 'core-js/es6/set';<br />

Build and fun!