fix recipe detail link
This commit is contained in:
parent
49017ab39a
commit
3463ca405a
2 changed files with 6 additions and 12 deletions
|
|
@ -330,7 +330,7 @@
|
|||
<td class="px-4 py-4 flex">
|
||||
<!-- <recipe-modal productCode="{{ recipe.productCode }}"></recipe-modal> -->
|
||||
<a
|
||||
routerLink="/recipe/{{ recipe.productCode }}"
|
||||
routerLink="/{{department}}/recipe/{{ recipe.productCode }}"
|
||||
class="btn btn-ghost"
|
||||
>
|
||||
<svg
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import {
|
|||
tap,
|
||||
} from 'rxjs';
|
||||
import * as lodash from 'lodash';
|
||||
import { RouterLink } from '@angular/router';
|
||||
import { ActivatedRoute, RouterLink } from '@angular/router';
|
||||
import { NgSelectModule } from '@ng-select/ng-select';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { MaterialService } from 'src/app/core/services/material.service';
|
||||
|
|
@ -69,11 +69,11 @@ export class RecipesComponent implements OnInit, OnDestroy {
|
|||
saveTab: boolean = false;
|
||||
showSaveNoti: boolean = true;
|
||||
|
||||
tableCtx?: ElementRef;
|
||||
department: string = this.route.parent!.snapshot.params['department'];
|
||||
|
||||
|
||||
@ViewChild('table', { static: false }) set content(table: ElementRef) {
|
||||
// expose element ref for other fn
|
||||
this.tableCtx = table;
|
||||
|
||||
table.nativeElement.addEventListener(
|
||||
'scroll',
|
||||
|
|
@ -114,7 +114,8 @@ export class RecipesComponent implements OnInit, OnDestroy {
|
|||
|
||||
constructor(
|
||||
private _recipeService: RecipeService,
|
||||
private _materialService: MaterialService
|
||||
private _materialService: MaterialService,
|
||||
private route: ActivatedRoute,
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
|
@ -159,8 +160,6 @@ export class RecipesComponent implements OnInit, OnDestroy {
|
|||
},
|
||||
})
|
||||
|
||||
|
||||
|
||||
this._materialService
|
||||
.getMaterialCodes()
|
||||
.pipe(
|
||||
|
|
@ -351,11 +350,6 @@ export class RecipesComponent implements OnInit, OnDestroy {
|
|||
this.saveTab = true;
|
||||
}
|
||||
|
||||
scrollToTop() {
|
||||
const table = this.tableCtx!.nativeElement;
|
||||
table.scrollTo({ top: 0, behavior: 'smooth' });
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
if (this.currentCountryFilterSubScription) {
|
||||
this.currentCountryFilterSubScription.unsubscribe();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue