選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 

32 行
782 B

  1. import { Component } from "@angular/core";
  2. import { DataStorageService } from "../../shared/data-storage.service";
  3. import { AuthService } from "../../auth/auth.service";
  4. @Component({
  5. selector: 'app-header',
  6. templateUrl: './header.component.html'
  7. })
  8. export class HeaderComponent {
  9. constructor(private dataStorageService: DataStorageService, private authService: AuthService) {}
  10. onSaveData() {
  11. this.dataStorageService.storeRecipes().subscribe(
  12. response => {
  13. console.log(response);
  14. }
  15. );
  16. }
  17. onFetchData() {
  18. this.dataStorageService.fetchRecipes();
  19. }
  20. onLogout() {
  21. this.authService.logout();
  22. }
  23. isAuthenticated() {
  24. return this.authService.isAuthenticated();
  25. }
  26. }