Skip to content

Instantly share code, notes, and snippets.

@clement-joye
Created May 15, 2021 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clement-joye/35df9c66bd6085142e8f379c1b5f96d2 to your computer and use it in GitHub Desktop.
Save clement-joye/35df9c66bd6085142e8f379c1b5f96d2 to your computer and use it in GitHub Desktop.
import { Injectable } from '@angular/core';
import { DashboardCard } from './dashboard-gallery/dashboard-card';
import { datasources, cards } from './data';
@Injectable({
providedIn: 'root'
})
export class DataService {
getData(): DashboardCard[]{
let dashboardCards: DashboardCard[] = [];
cards.forEach( (card: any) => {
card["resources"] = datasources.filter( (x) => x["name"] == card["datasource"])[0].resources;
dashboardCards.push(card);
})
return dashboardCards;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment