Skip to content

Commit bbcac8e

Browse files
Update projects
1 parent 53b97af commit bbcac8e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+198
-750
lines changed

Angular/orig_.gitignore

Lines changed: 0 additions & 46 deletions
This file was deleted.

Angular/orig_package.json

Lines changed: 0 additions & 51 deletions
This file was deleted.

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 id="app-container">
2+
<dx-drop-down-button
3+
text="Sandra Johnson"
4+
icon="user"
5+
[items]="actions"
6+
keyExpr="id"
7+
displayExpr="text"
8+
(onItemClick)="onItemClick($event)"
9+
[splitButton]="true"
10+
(onButtonClick)="onButtonClick()"
11+
[dropDownOptions]="dropDownOptions"
12+
>
13+
</dx-drop-down-button>
314
</div>

Angular/src/app/app.component.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
.default-style {
2-
margin: 50px;
3-
width: 90vw;
1+
#app-container {
2+
width: 900px;
3+
position: relative;
4+
padding: 50px;
45
}

Angular/src/app/app.component.ts

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,30 @@
11
import { Component } from '@angular/core';
2-
import { ClickEvent } from 'devextreme/ui/button';
2+
import notify from 'devextreme/ui/notify';
3+
import { DxDropDownButtonTypes } from 'devextreme-angular/ui/drop-down-button';
4+
import { Action, DropDownOptions } from './app.types';
35

46
@Component({
57
selector: 'app-root',
68
templateUrl: './app.component.html',
79
styleUrls: ['./app.component.scss'],
810
})
911
export class AppComponent {
10-
title = 'Angular';
12+
actions: Action[] = [
13+
{ id: 1, text: 'My profile', icon: 'user' },
14+
{ id: 2, text: 'Messages', icon: 'email' },
15+
{ id: 3, text: 'Contacts', icon: 'group' },
16+
{ id: 4, text: 'Log out', icon: 'runner' },
17+
];
1118

12-
counter = 0;
19+
dropDownOptions: DropDownOptions = {
20+
height: 150,
21+
};
1322

14-
buttonText = 'Click count: 0';
23+
onItemClick(e: DxDropDownButtonTypes.ItemClickEvent): void {
24+
notify(`${e.itemData.text} was clicked`, 'info', 2000);
25+
}
1526

16-
onClick(e: ClickEvent): void {
17-
this.counter++;
18-
this.buttonText = `Click count: ${this.counter}`;
27+
onButtonClick(): void {
28+
notify('Main button was clicked', 'success', 2000);
1929
}
2030
}

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 { DxDropDownButtonModule } from 'devextreme-angular/ui/drop-down-button';
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+
DxDropDownButtonModule,
1515
],
1616
providers: [],
1717
bootstrap: [AppComponent],

Angular/src/app/app.types.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export interface Action {
2+
id: number;
3+
text: string;
4+
icon: string;
5+
}
6+
7+
export interface DropDownOptions {
8+
height: number;
9+
}

Angular/src/app/orig_app.component.css

Whitespace-only changes.

Angular/src/app/orig_app.component.html

Lines changed: 0 additions & 11 deletions
This file was deleted.

Angular/src/app/orig_app.component.spec.ts

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)