HarveyChou 2 years ago
parent
commit
3364218bf4
  1. 24
      src/app/form-container/form-container.component.css
  2. 10
      src/app/form-container/form-container.component.html
  3. 23
      src/app/form-container/form-container.component.spec.ts
  4. 15
      src/app/form-container/form-container.component.ts

24
src/app/form-container/form-container.component.css

@ -0,0 +1,24 @@
:host {
display: block;
border: solid 1px #aaa;
}
.title {
display: flex;
padding: 0 10px;
flex-direction: row;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #aaa;
}
.content {
padding: 10px;
min-height: 100px;
}
.button {
padding: 10px;
border-top: 1px solid #aaa;
text-align: center;
}

10
src/app/form-container/form-container.component.html

@ -0,0 +1,10 @@
<div class="title">
<ng-content select="h3"></ng-content>
<ng-content select=".sub-title"></ng-content>
</div>
<div class="content">
<ng-content></ng-content>
</div>
<div class="button">
<ng-content select="[form-button]"></ng-content>
</div>

23
src/app/form-container/form-container.component.spec.ts

@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FormContainerComponent } from './form-container.component';
describe('FormContainerComponent', () => {
let component: FormContainerComponent;
let fixture: ComponentFixture<FormContainerComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ FormContainerComponent ]
})
.compileComponents();
fixture = TestBed.createComponent(FormContainerComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

15
src/app/form-container/form-container.component.ts

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-form-container',
templateUrl: './form-container.component.html',
styleUrls: ['./form-container.component.css']
})
export class FormContainerComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}
Loading…
Cancel
Save