This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author Muhammad Faisal | |
* @description Pipe to replace the value with * or specified character. | |
*/ | |
// Angular Imports | |
import { Pipe, PipeTransform } from '@angular/core'; | |
@Pipe({ | |
name: 'password' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author Muhammad Faisal | |
* @description Service for getting data. | |
*/ | |
// Angular Imports | |
import { Injectable } from '@angular/core'; | |
import { HttpErrorResponse } from '@angular/common/http'; | |
import { forkJoin as observableForkJoin, Observable } from 'rxjs'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author Muhammad FAISAL | |
* @description Controls the display of html contents only during development mode. | |
* @example <button development-only>Some Button</button> | |
*/ | |
// Angular Imports | |
import { Directive, OnInit, ElementRef, isDevMode } from '@angular/core'; | |
// Define class for the Directive |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Customized HTML5 local storage class with additional functionality. | |
*/ | |
export class LocalStorage { | |
/** | |
* Checks if the browser supports local storage. | |
* @returns true if the local storage is supported; false otherwise. | |
*/ | |
public static isSupported(): boolean { | |
try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class Mapping { | |
/** | |
* Checks if the given json object is type of a given instance (class/interface) type. | |
* @param jsonObject Object to check. | |
* @param instanceType The type to check for the object. | |
* @returns true if object is of the given instance type; false otherwise. | |
*/ | |
public static isTypeOf<T>(jsonObject: Object, instanceType: { new(): T; }): boolean { | |
// Check that all the properties of the JSON Object are also available in the Class. | |
const instanceObject = new instanceType(); |