Skip to content

Commit f38a121

Browse files
arman-boyakhchyanDevExpressExampleBot
andauthored
Add Angular (#2)
* Add Angular * README auto update [skip ci] * Minor CSS update * Minor CSS update * Update following feedback * Minor CSS update --------- Co-authored-by: DevExpressExampleBot <[email protected]>
1 parent 3506d9c commit f38a121

File tree

5 files changed

+46
-10
lines changed

5 files changed

+46
-10
lines changed

Angular/src/app/app.component.html

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1-
<div class="default-style">
2-
<dx-button [text]="buttonText" (onClick)="onClick($event)"></dx-button>
1+
<div class="demo-container">
2+
<div class="file-uploader-block">
3+
<dx-file-uploader
4+
id="file-uploader"
5+
[multiple]="true"
6+
uploadMode="useButtons"
7+
[allowCanceling]="true"
8+
accept="image/*"
9+
labelText="Drop Images Here to Upload..."
10+
[maxFileSize]="32000000"
11+
dropZone=".file-uploader-block"
12+
></dx-file-uploader>
13+
</div>
314
</div>

Angular/src/app/app.component.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
.default-style {
2-
margin: 50px;
3-
width: 90vw;
4-
}

Angular/src/app/app.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { NgModule } from '@angular/core';
22
import { BrowserModule } from '@angular/platform-browser';
3-
import { DxButtonModule } from 'devextreme-angular/ui/button';
3+
import { DxFileUploaderModule } from 'devextreme-angular/ui/file-uploader';
44
import { AppRoutingModule } from './app-routing.module';
55
import { AppComponent } from './app.component';
66

@@ -11,7 +11,7 @@ import { AppComponent } from './app.component';
1111
imports: [
1212
BrowserModule,
1313
AppRoutingModule,
14-
DxButtonModule,
14+
DxFileUploaderModule,
1515
],
1616
providers: [],
1717
bootstrap: [AppComponent],

Angular/src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<meta name="viewport" content="width=device-width, initial-scale=1" />
88
<link rel="icon" type="image/x-icon" href="favicon.ico" />
99
</head>
10-
<body>
10+
<body class="dx-viewport">
1111
<app-root></app-root>
1212
</body>
1313
</html>

Angular/src/styles.scss

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,30 @@
1-
/* You can add global styles to this file, and also import other style files */
1+
.demo-container {
2+
margin: 50px;
3+
height: 50vh;
4+
}
5+
6+
.file-uploader-block {
7+
width: 100%;
8+
height: 100%;
9+
background-color: #f5f5f5;
10+
border-radius: 16px;
11+
}
12+
13+
#file-uploader {
14+
height: 100%;
15+
}
16+
17+
.dx-fileuploader-input-wrapper {
18+
position: relative;
19+
display: flex;
20+
flex-direction: column;
21+
align-items: center;
22+
}
23+
24+
.dx-fileuploader-input-container {
25+
text-align: center;
26+
}
27+
28+
#file-uploader .dx-fileuploader-wrapper {
29+
overflow-y: auto;
30+
}

0 commit comments

Comments
 (0)