From 510a4a0f65ec6a21ec3bdddbff7283f1eee46286 Mon Sep 17 00:00:00 2001 From: HarveyChou Date: Thu, 3 Nov 2022 15:45:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8B=95=E6=85=8B=E5=85=A7=E5=AE=B9=E6=8A=95?= =?UTF-8?q?=E5=BD=B1=20ng-content=20Select=E5=8A=9F=E8=83=BD=20=E6=A8=99?= =?UTF-8?q?=E7=B1=A4(Tag)=20Select=3D"=E6=A8=99=E7=B1=A4=E5=90=8D"=20Ex:se?= =?UTF-8?q?lect=3D"h2"=20=E6=A8=A3=E5=BC=8F=E9=A1=9E=E5=88=A5(Class)=20sel?= =?UTF-8?q?ect=3D".=E9=A1=9E=E5=88=A5=E5=90=8D=E7=A8=B1"=20Ex:select=3D".c?= =?UTF-8?q?lassName"=20=E5=B1=AC=E6=80=A7(Attribute)=20select=3D"[?= =?UTF-8?q?=E5=B1=AC=E6=80=A7=E5=90=8D=E7=A8=B1]"=20Ex:select=3D"[attrName?= =?UTF-8?q?]"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app.component.html | 11 ++++++--- src/app/app.module.ts | 4 +++- .../form-container.component.css | 24 +++++++++++++++++++ .../form-container.component.html | 10 ++++++++ .../form-container.component.spec.ts | 23 ++++++++++++++++++ .../form-container.component.ts | 15 ++++++++++++ 6 files changed, 83 insertions(+), 4 deletions(-) create mode 100644 src/app/form-container/form-container.component.css create mode 100644 src/app/form-container/form-container.component.html create mode 100644 src/app/form-container/form-container.component.spec.ts create mode 100644 src/app/form-container/form-container.component.ts diff --git a/src/app/app.component.html b/src/app/app.component.html index cb1e860..0727e79 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,3 +1,8 @@ - -
AppComponent 指定內容
-
+ +

這是標題表單

+
標題副表單
+ 表單內容 +
+ +
+
diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 48e3f3f..bf2e200 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -5,11 +5,13 @@ import { BrowserModule } from '@angular/platform-browser'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { ChildComponent } from './child/child.component'; +import { FormContainerComponent } from './form-container/form-container.component'; @NgModule({ declarations: [ AppComponent, - ChildComponent + ChildComponent, + FormContainerComponent ], imports: [ BrowserModule, diff --git a/src/app/form-container/form-container.component.css b/src/app/form-container/form-container.component.css new file mode 100644 index 0000000..2ab5d69 --- /dev/null +++ b/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; +} diff --git a/src/app/form-container/form-container.component.html b/src/app/form-container/form-container.component.html new file mode 100644 index 0000000..f775757 --- /dev/null +++ b/src/app/form-container/form-container.component.html @@ -0,0 +1,10 @@ +
+ + +
+
+ +
+
+ +
diff --git a/src/app/form-container/form-container.component.spec.ts b/src/app/form-container/form-container.component.spec.ts new file mode 100644 index 0000000..3fc3a58 --- /dev/null +++ b/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; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ FormContainerComponent ] + }) + .compileComponents(); + + fixture = TestBed.createComponent(FormContainerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/form-container/form-container.component.ts b/src/app/form-container/form-container.component.ts new file mode 100644 index 0000000..86019be --- /dev/null +++ b/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 { + } + +}