mur*_*983 3 html css angular angular-forms
我有一个Angular 5
正在使用的网站routing
。
在我的代码分支中,我有一个文件夹,其中包含带有各种数据的部分。
然后,我要做的是在主页上显示我需要完成的部分,但是问题是,因为我有2个component.html
文件嵌套在一个文件中,所以它在单独的行上显示了我的信息部分。
我试过了:
DIV
主页上mat-card
个人详细信息组件html
<mat-card>
<mat-card-title class="firstCard">Personal details</mat-card-title>
<mat-card-content>
<mat-form-field>
<input matInput id="invName" placeholder="Full name" #name value="Mr Test Test" readonly>
</mat-form-field>
<mat-form-field>
<input matInput id="invRef" placeholder="Investor reference" #ref value="A11111" readonly>
</mat-form-field>
<mat-form-field>
<input matInput id="invId" placeholder="Investor ID" #id value="101010" readonly>
</mat-form-field>
<mat-form-field>
<input matInput id="invDoB" placeholder="Date of birth" #dob value="01 January 1950" readonly>
</mat-form-field>
<mat-form-field>
<input matInput id="invNino" placeholder="National Insurance Number" #nino value="AA112233A" readonly>
</mat-form-field>
<mat-form-field>
<input matInput id="invMumMaidenName" placeholder="Mother's maiden name" #mummaidenname value="Test" readonly>
</mat-form-field>
<mat-form-field>
<input matInput id="invFirstSchool" placeholder="First school attended" #firstschool value="St.Testo" readonly>
</mat-form-field>
</mat-card-content>
</mat-card>
Run Code Online (Sandbox Code Playgroud)
联系人详细信息组件html
<mat-card>
<mat-card-title class="secondCard">Contact details</mat-card-title>
<mat-card-content>
<mat-form-field>
<input matInput id="invAddress" placeholder="Address" #address value="'this is a description of the some text' + \n + 'and further description'" readonly>
</mat-form-field>
<mat-form-field>
<input matInput id="invPhone" placeholder="Telephone number" #tel value="01000 000 000" readonly>
</mat-form-field>
<mat-form-field>
<input matInput id="invEmail" placeholder="Email address" #email value="test@test.com" readonly>
</mat-form-field>
</mat-card-content>
</mat-card>
Run Code Online (Sandbox Code Playgroud)
**主页组件html **
<div>
<app-personaldetails></app-personaldetails>
<app-contactdetails></app-contactdetails>
</div>
Run Code Online (Sandbox Code Playgroud)
小智 5
尝试使用Flex布局,并且由于您正在使用Angular,请尝试使用Angular Flex Layout。
这将给出这样的内容:
<div fxLayout="row" fxLayoutAlign="start center">
<app-personaldetails fxFlex="50%"></app-personaldetails>
<app-contactdetails fxFlex="50%"></app-contactdetails>
</div>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
7528 次 |
最近记录: |