Created
November 9, 2020 22:02
-
-
Save blogcacanid/8edac19289b0c80460a761ff31391b7e to your computer and use it in GitHub Desktop.
home.component.ts Authentication JWT Angular 9 Lumen 7
This file contains hidden or 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 '../_services/user.service'; | |
@Component({ | |
selector: 'app-home', | |
templateUrl: './home.component.html', | |
styleUrls: ['./home.component.css'] | |
}) | |
export class HomeComponent implements OnInit { | |
content: string; | |
constructor(private userService: UserService) { } | |
ngOnInit(): void { | |
this.userService.getPublicContent().subscribe( | |
data => { | |
this.content = data; | |
}, | |
err => { | |
this.content = JSON.parse(err.error).message; | |
} | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment