ngx-admin/src/app/public/home/home.component.ts

127 lines
3 KiB
TypeScript
Raw Normal View History

import {Component, OnDestroy} from '@angular/core';
import { NbThemeService } from '@nebular/theme';
import { takeWhile } from 'rxjs/operators' ;
import { SolarData } from '../../@core/data/solar';
2024-10-23 18:48:28 -03:00
import { Banner } from '../../admin/banner/banner.model';
import { Subject } from 'rxjs';
import { Category } from '../../admin/category/category.model';
import { Product } from '../../admin/product/product';
interface CardSettings {
title: string;
iconClass: string;
type: string;
}
2017-04-13 14:24:23 +03:00
@Component({
2024-10-13 16:57:31 -03:00
selector: 'ngx-home',
styleUrls: ['./home.component.scss'],
templateUrl: './home.component.html',
2017-04-13 14:24:23 +03:00
})
2024-10-13 16:57:31 -03:00
export class HomeComponent implements OnDestroy {
2024-10-23 18:48:28 -03:00
private destroy$: Subject<void> = new Subject<void>();
banners: Banner[];
categories: Category[];
products: any[];
2024-10-23 18:48:28 -03:00
constructor() {}
2024-10-23 18:48:28 -03:00
ngOnInit(): void {
console.log('init');
2024-10-23 18:48:28 -03:00
this.categories = [
{
2024-10-23 18:48:28 -03:00
"name": "Nutrientes",
"id": "Nutrientes",
"updatedAt": new Date(),
"createdAt": new Date(),
"icon": "arrow-ios-back-outline"
},
{
"name": "Iluminação",
"id": "Decoração",
"updatedAt": new Date(),
"createdAt": new Date(),
"icon": "bulb-outline"
},
{
"name": "Hidroponia",
"id": "Hidroponia",
"updatedAt": new Date(),
"createdAt": new Date(),
"icon": "droplet-outline"
},
{
"name": "Irrigação",
"id": "Irrigação",
"updatedAt": new Date(),
"createdAt": new Date(),
"icon": "arrow-ios-back-outline"
},
{
"name": "Colheita",
"id": "Colheita",
"updatedAt": new Date(),
"createdAt": new Date(),
"icon": "arrow-ios-back-outline"
},
{
"name": "Pragas",
"id": "Pragas",
"updatedAt": new Date(),
"createdAt": new Date(),
"icon": "arrow-ios-back-outline"
},
{
"name": "Potes e Vasos",
"id": "Potes e Vasos",
"updatedAt": new Date(),
"createdAt": new Date(),
"icon": "arrow-ios-back-outline"
},
{
"name": "Substratos",
"id": "Substratos",
"updatedAt": new Date(),
"createdAt": new Date(),
"icon": "arrow-ios-back-outline"
},
{
"name": "Controle",
"id": "Controle",
"updatedAt": new Date(),
"createdAt": new Date(),
"icon": "arrow-ios-back-outline"
},
{
"name": "Clonagem",
"id": "Clonagem",
"updatedAt": new Date(),
"createdAt": new Date(),
"icon": "copy-outline"
},
{
"name": "Tendas",
"id": "Tendas",
"updatedAt": new Date(),
"createdAt": new Date(),
"icon": "arrow-ios-back-outline"
},
{
"name": "Circulação",
"id": "Circulação",
"updatedAt": new Date(),
"createdAt": new Date(),
"icon": "arrow-ios-back-outline"
},
]
2024-10-23 18:48:28 -03:00
this.products = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
}
ngOnDestroy() {
2024-10-23 18:48:28 -03:00
this.destroy$.next();
this.destroy$.complete();
}
2017-04-13 14:24:23 +03:00
}