Mise à jour articles et produits
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { Title } from '@angular/platform-browser';
|
||||
import { trigger, state, style, animate, transition } from '@angular/animations';
|
||||
import { Component, DestroyRef, inject, OnInit } from '@angular/core';
|
||||
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatDividerModule } from '@angular/material/divider';
|
||||
import { Observable, Subscription } from 'rxjs';
|
||||
|
||||
import { ListErrorsComponent, } from 'src/app/components/shared';
|
||||
import { Errors, Jump } from 'src/app/core/models';
|
||||
import { JumpsService } from 'src/app/core/services';
|
||||
import { Errors } from 'src/app/core/models';
|
||||
//import { UserService } from 'src/app/core/services';
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
@@ -35,28 +34,18 @@ import { JumpsService } from 'src/app/core/services';
|
||||
]
|
||||
})
|
||||
export class HomeComponent implements OnInit {
|
||||
private _lastjump: Subscription = new Subscription();
|
||||
private _lastjump$: Observable<Jump> = new Observable();
|
||||
public title = 'Shop bientôt disponible!';
|
||||
public description = 'Encore un peu de patience, notre shop sera mis en ligne d\'ici peu.';
|
||||
public errors: Errors = { errors: {} };
|
||||
public lastJump: Jump = {} as Jump;
|
||||
public destroyRef = inject(DestroyRef);
|
||||
public now = new Date();
|
||||
|
||||
constructor(
|
||||
private _jumpsService: JumpsService
|
||||
private titleService: Title
|
||||
//private _userService: UserService
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
this._lastjump$ = this._jumpsService.getLastJump().pipe(takeUntilDestroyed(this.destroyRef));
|
||||
this._lastjump = this._lastjump$.subscribe((jump) => {
|
||||
this.lastJump = jump;
|
||||
});
|
||||
}
|
||||
private _isToday(someDate: Date) {
|
||||
return someDate.getDate() == this.now.getDate() &&
|
||||
someDate.getMonth() == this.now.getMonth() &&
|
||||
someDate.getFullYear() == this.now.getFullYear()
|
||||
this.titleService.setTitle(this.title);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user