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
import { Injectable, OnDestroy } from '@angular/core'; | |
import { BreakpointObserver, BreakpointState } from '@angular/cdk/layout'; | |
import { distinctUntilChanged, Observable, pluck, Subject, takeUntil, tap } from 'rxjs'; | |
export type DeviceType = 'mobile' | 'tablet' | 'desktop'; | |
export const DeviceMediaQuery: Record<DeviceType, string> = { | |
mobile: '(max-width: 400px)', | |
tablet: '(min-width: 401px) and (max-width: 700px)', | |
desktop: '(min-width: 701px) and (max-width: 1800px)' |
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
import { virtualFs, workspaces } from "@angular-devkit/core"; | |
import { Rule, SchematicsException, Tree, noop } from '@angular-devkit/schematics'; | |
/* | |
These functions referene has been taken from below links:- | |
https://angular.io/guide/schematics-for-libraries#define-a-generation-rule | |
https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/utility/workspace.ts | |
*/ | |
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
/** | |
* Filters an array of objects using custom predicates. | |
* | |
* @param {Array} array: the array to filter | |
* @param {Object} filters: an object with the filter criteria | |
* @return {Array} | |
*/ | |
function filterArray(array, filters) { | |
const filterKeys = Object.keys(filters); | |
return array.filter(item => { |
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
Please be a bit more specific when asking a question: What have you tried so far, with a code example? / What do you expect? / What error do you get? For help, take a look at "[How to ask](//stackoverflow.com/help/how-to-ask)". | |
You should consider posting this as an answer and accepting it so others can see that your problem was solved, especially if you solved it yourself :) | |
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes | |
We will not do your entire homework for you, only help you with it. Show us your code and focus on a specific problem you're having. Tell us what you already understood, where you are struggling, and [what you've tried](https://stackoverflow.com/help/how-to-ask) | |
Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce |