building out category form
This commit is contained in:
parent
759086f7c5
commit
2c6d0c1d0c
3 changed files with 16 additions and 4 deletions
|
|
@ -7,8 +7,11 @@
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<div class="category-list">
|
<div class="category-list">
|
||||||
@for (category of categories(); track category.id) {
|
@for (category of categories(); track category.id) {
|
||||||
<div>
|
<!-- TODO: Convert to form...-->
|
||||||
{{ category.name }}
|
<div class="category-item">
|
||||||
|
<div>{{ category.name }}</div>
|
||||||
|
|
||||||
|
<button matIconButton><mat-icon>edit</mat-icon></button>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@if (!categories().length) {
|
@if (!categories().length) {
|
||||||
|
|
|
||||||
|
|
@ -15,5 +15,10 @@
|
||||||
.category-list {
|
.category-list {
|
||||||
padding-top: 1rem;
|
padding-top: 1rem;
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 0.5rem;
|
}
|
||||||
|
|
||||||
|
.category-item {
|
||||||
|
display: flex;
|
||||||
|
gap: 0.5rem;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,15 @@
|
||||||
import { Component, computed } from '@angular/core';
|
import { Component, computed } from '@angular/core';
|
||||||
import { CategoryService } from '../../../services/category.service';
|
import { CategoryService } from '../../../services/category.service';
|
||||||
import { MatCardModule } from '@angular/material/card';
|
import { MatCardModule } from '@angular/material/card';
|
||||||
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
|
import { MatButtonModule } from '@angular/material/button';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-categories',
|
selector: 'app-categories',
|
||||||
imports: [
|
imports: [
|
||||||
MatCardModule
|
MatCardModule,
|
||||||
|
MatIconModule,
|
||||||
|
MatButtonModule
|
||||||
],
|
],
|
||||||
templateUrl: './categories.component.html',
|
templateUrl: './categories.component.html',
|
||||||
styleUrl: './categories.component.scss'
|
styleUrl: './categories.component.scss'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue