我正在创建一个角度远程应用程序,我想在其他应用程序中重用组件。为了做到这一点,我使用 angular 12 制作了一个测试项目,带有 angular 材料和模块联合。
除了使用有角材料的组件外,该应用程序运行良好,您可以在下面看到远程和外壳中的 UI。我还附上了组件的 html 实现。
<style> input[type=text] {
width: 100%;
max-width: 400px;
box-sizing: border-box;
border: none;
border-bottom: 2px solid silver;
font-size: 20px;
margin-bottom: 20px;
margin-top: 20px;}
button {
border: 2px solid silver;
color: green;
background-color: white;
font-size: 16px;
padding: 10px;
padding-left: 40px;
padding-right: 40px;
border-radius: 10px;
margin-bottom: 20px;
margin-top: 20px;
cursor: pointer;} button:active {
border-color: black; }
#container {
border: 2px darkred dashed;
padding: 20px;
}
</style>
<div class="file-picker">
<div class="row">
<div class="col-md-3">
<input type="file" #file placeholder="Choose file"
(change)="uploadFile(file.files)" style="display: none">
<button type="button" class="btn btn-success" mat-button
(click)="file.click()">Upload File to bucket <mat-
icon>attach_file</mat-icon></button>
<span *ngIf="convertToSvfService.inProgress"class="upload">
<mat-progress-bar mode="query"></mat-progress-bar>
</span>
</div>
</div>
</div>