Commit 121fc94e by Ooh-Ao

layout

parent 5d42c4e0
import { Routes } from '@angular/router';
import { ServicesComponent } from './services/services.component';
import { SettingWidgetComponent } from './setting-widget/setting-widget.component';
import { LayoutWidjetComponent } from './layout-widjet/layout-widjet.component';
export const routes: Routes = [
{
......@@ -20,5 +21,9 @@ export const routes: Routes = [
component: ServicesComponent
// loadComponent: () => import('./offerings/index')
// .then(x => x.ServicesComponent),
},
{
path: 'layout',
component: LayoutWidjetComponent
}
];
<div class="row">
<app-services [id]="item.id" *ngFor="let item of widgetList" class="col-{{item.width}} p-1"></app-services>
</div>
/* tslint:disable:no-unused-variable */
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { LayoutWidjetComponent } from './layout-widjet.component';
describe('LayoutWidjetComponent', () => {
let component: LayoutWidjetComponent;
let fixture: ComponentFixture<LayoutWidjetComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LayoutWidjetComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(LayoutWidjetComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { ServicesComponent } from '../services/services.component';
import { WidjetService } from '../services/widjet.service';
import { Service } from '../components';
import { CommonModule } from '@angular/common';
@Component({
selector: 'app-layout-widjet',
standalone: true,
imports: [CommonModule, ServicesComponent],
templateUrl: './layout-widjet.component.html',
styleUrls: ['./layout-widjet.component.css']
})
export class LayoutWidjetComponent implements OnInit {
widjetId = 0
widgetList: Service[] = []
constructor(private widjetService: WidjetService) {
this.widgetList = this.widjetService.widjetList
}
ngOnInit() {
}
}
......@@ -12,7 +12,7 @@ export class WidjetService {
dataModel: "ss",
dataSoure: "sss",
api: "",
width: 12,
width: 6,
heigth: "",
tag: ""
},
......@@ -23,7 +23,7 @@ export class WidjetService {
dataModel: "ss",
dataSoure: "sss",
api: "",
width: 5,
width: 6,
heigth: "",
tag: ""
},
......@@ -45,10 +45,32 @@ export class WidjetService {
dataModel: "4444",
dataSoure: "2312",
api: "https://hrplus.myhr.co.th/hr/taapi/leave/statistic?yearId=2024",
width: 5,
width: 3,
heigth: "",
tag: ""
},
{
id: 3,
title: "4444",
description: "4444",
dataModel: "4444",
dataSoure: "2312",
api: "https://hrplus.myhr.co.th/hr/taapi/leave/statistic?yearId=2024",
width: 3,
heigth: "",
tag: ""
},
{
id: 3,
title: "4444",
description: "4444",
dataModel: "4444",
dataSoure: "2312",
api: "https://hrplus.myhr.co.th/hr/taapi/leave/statistic?yearId=2024",
width: 3,
heigth: "",
tag: ""
}]
},]
constructor() { }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment