Skip to content
Permalink
c415323a5e
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
39 lines (32 sloc) 1.04 KB
import { Component, OnInit } from '@angular/core';
import { GeneratorService } from '../services/generator.service';
import { Router } from '@angular/router';
@Component({
selector: 'app-generator-search',
templateUrl: './generator-search.component.html',
styleUrls: ['./generator-search.component.css']
})
export class GeneratorSearchComponent implements OnInit {
constructor(public data: GeneratorService, private router: Router) { }
public generators$: Object;
goToGenerator(gen_id, org_id) {
this.router.navigateByUrl('/statistics');
// console.log(gen_id);
// console.log(org_id);
localStorage.setItem('gen_id', gen_id);
localStorage.setItem('org_id', org_id);
}
ngOnInit() {
const jsonToken = localStorage.getItem('auth_token');
try {
this.data.getGenerators(jsonToken).subscribe((data) => {
// console.log(data);
this.generators$ = data;
return this.generators$;
});
} catch (err) {
return err;
}
// this.generators$ = this.getGeneratorName();
}
}