prepared history
This commit is contained in:
46
src/app/services/history.service.ts
Normal file
46
src/app/services/history.service.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* Copyright (C) 2018 Michael Czechowski <mail@dailysh.it>
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation; version 2.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc., 51
|
||||
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import { Inject, Injectable, Optional, ViewChild } from '@angular/core';
|
||||
import * as Selection from 'd3-selection';
|
||||
|
||||
import { Graph } from '../models/graph.model';
|
||||
|
||||
@Injectable()
|
||||
export class HistoryService {
|
||||
|
||||
public history: any[];
|
||||
|
||||
constructor() {
|
||||
this.history = [];
|
||||
}
|
||||
|
||||
public save(graphs: Graph[], config) {
|
||||
this.history.push({
|
||||
date: new Date(),
|
||||
graphs: graphs,
|
||||
config: config
|
||||
});
|
||||
|
||||
console.log(config);
|
||||
}
|
||||
|
||||
public list() {
|
||||
return this.history;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user