Skip to content

Instantly share code, notes, and snippets.

@dasmido
Created January 20, 2018 21:50
Show Gist options
  • Save dasmido/ad17b84d49e8e1c0aec3e0e368a76000 to your computer and use it in GitHub Desktop.
Save dasmido/ad17b84d49e8e1c0aec3e0e368a76000 to your computer and use it in GitHub Desktop.
import { Component, OnInit } from '@angular/core';
import {AuthService} from '../../services/auth.service';
import {Router} from '@angular/router';
@Component({
selector: 'app-profile',
templateUrl: './profile.component.html',
styleUrls: ['./profile.component.css']
})
export class ProfileComponent implements OnInit {
user: Object;
constructor(
private authService: AuthService,
private router: Router) { }
ngOnInit() {
this.authService.getProfile().subscribe(profile => {
this.user = profile.user;
},
err => {
console.log(err);
return false;
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment