Last active
February 17, 2019 19:51
-
-
Save abbasogaji/ab611f9e80ca6fb4402c7f3332ad75ce to your computer and use it in GitHub Desktop.
This file contains 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 { Component, OnInit } from '@angular/core'; | |
import { UserService } from './user.services'; | |
import { trigger } from '@angular/animations'; | |
import { fadeIn } from '../animation/fadeIn'; | |
@Component({ | |
selector: 'app-user', | |
templateUrl: './user.component.html', | |
styleUrls: ['./user.component.css'], | |
providers: [UserService], | |
animations : [ | |
trigger('fadeIn', fadeIn()) | |
] | |
}) | |
export class UserComponent implements OnInit { | |
dataLoaded = false; | |
repodata : [] | |
user : {name : string, email: string} = {name : null, email : null } | |
constructor(private userService : UserService) { | |
} | |
ngOnInit() { | |
this.userService.fetchData().subscribe((res : {userdata : {name : string, email: string}, repodata:[]}) => { | |
this.repodata = res.repodata; | |
this.user = res.userdata; | |
this.dataLoaded = true; | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment