commit 3bbc76ad1979bc68bea8ed3149b91c03b3534149
parent 0a5202bdc4a2e8e20a100f7bb1654a9e3666fa39
Author: MTRNord <mtrnord1@gmail.com>
Date: Sun, 25 Feb 2018 17:34:34 +0100
Call API earlier
Diffstat:
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/app/papers-list/papers-list.component.ts b/src/app/papers-list/papers-list.component.ts
@@ -1,4 +1,4 @@
-import {Component, OnInit} from '@angular/core';
+import {Component} from '@angular/core';
import {ApiService, Paper} from '../api.service';
@Component({
@@ -6,12 +6,12 @@ import {ApiService, Paper} from '../api.service';
templateUrl: './papers-list.component.html',
styleUrls: ['./papers-list.component.scss']
})
-export class PapersListComponent implements OnInit {
+export class PapersListComponent {
data: (Paper)[][];
- constructor(private apiService: ApiService) {}
-
- ngOnInit() { this.getPapers(); }
+ constructor(private apiService: ApiService) {
+ this.getPapers();
+ }
getPapers() {
this.apiService.getPapers()
diff --git a/src/app/tweet-list/tweet-list.component.ts b/src/app/tweet-list/tweet-list.component.ts
@@ -1,4 +1,4 @@
-import {Component, Input, OnInit} from '@angular/core';
+import {Component, Input} from '@angular/core';
import {ApiService, TweetsEntity} from '../api.service';
@@ -7,13 +7,13 @@ import {ApiService, TweetsEntity} from '../api.service';
templateUrl: './tweet-list.component.html',
styleUrls: ['./tweet-list.component.scss']
})
-export class TweetListComponent implements OnInit {
+export class TweetListComponent {
@Input() uuid;
data: (TweetsEntity)[][];
- constructor(private apiService: ApiService) {}
-
- ngOnInit() { this.getYesterday(); }
+ constructor(private apiService: ApiService) {
+ this.getYesterday();
+ }
getYesterday() {
this.apiService.getYesterday(this.uuid)