Skip to content

Commit 5228b27

Browse files
author
Vitor Durante
committed
Install and configure @material/angular
1 parent c10a593 commit 5228b27

File tree

7 files changed

+194
-16
lines changed

7 files changed

+194
-16
lines changed

angular/.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "chrome",
9+
"request": "launch",
10+
"name": "Launch Chrome against localhost",
11+
"url": "http://localhost:4200",
12+
"sourceMaps": true,
13+
"webRoot": "${workspaceFolder}"
14+
}
15+
]
16+
}

angular/angular.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
}
3232
],
3333
"styles": [
34+
"node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
3435
"src/assets/fonts/roboto/roboto.css",
3536
"node_modules/bootstrap/dist/css/bootstrap.min.css",
3637
"node_modules/simple-line-icons/css/simple-line-icons.css",

angular/package-lock.json

Lines changed: 45 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

angular/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313
},
1414
"private": true,
1515
"dependencies": {
16-
"@angular/animations": "^7.1.3",
16+
"@angular/animations": "^7.1.4",
17+
"@angular/cdk": "^7.2.0",
1718
"@angular/common": "^7.1.3",
1819
"@angular/compiler": "^7.1.3",
1920
"@angular/core": "^7.1.3",
2021
"@angular/forms": "^7.1.3",
2122
"@angular/http": "^7.1.3",
23+
"@angular/material": "^7.2.0",
2224
"@angular/platform-browser": "^7.1.3",
2325
"@angular/platform-browser-dynamic": "^7.1.3",
2426
"@angular/router": "^7.1.3",
@@ -42,6 +44,7 @@
4244
"famfamfam-flags": "^1.0.0",
4345
"flot": "^0.8.0-alpha",
4446
"font-awesome": "^4.7.0",
47+
"hammerjs": "^2.0.8",
4548
"jquery": "^3.1.1",
4649
"jquery-countto": "^1.2.0",
4750
"jquery-migrate": "^3.0.0",

angular/src/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import * as moment from 'moment';
88

99
import 'moment/min/locales.min';
1010
import 'moment-timezone';
11+
import 'hammerjs';
1112

1213
if (environment.production) {
1314
enableProdMode();
@@ -30,4 +31,4 @@ if (environment.hmr) {
3031
}
3132
} else {
3233
bootstrap(); //Regular bootstrap
33-
}
34+
}

angular/src/root.module.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { BrowserModule } from '@angular/platform-browser';
2-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
1+
import { BrowserModule, HAMMER_GESTURE_CONFIG } from '@angular/platform-browser';
2+
import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations';
33
import { NgModule, Injector, APP_INITIALIZER, LOCALE_ID } from '@angular/core';
44
import { PlatformLocation, registerLocaleData } from '@angular/common';
55

@@ -20,6 +20,8 @@ import { AppPreBootstrap } from './AppPreBootstrap';
2020
import { ModalModule } from 'ngx-bootstrap';
2121
import { HttpClientModule } from '@angular/common/http';
2222

23+
import { GestureConfig } from '@angular/material';
24+
2325
import * as _ from 'lodash';
2426

2527
export function appInitializerFactory(injector: Injector,
@@ -93,7 +95,9 @@ export function getCurrentLanguage(): string {
9395
AbpModule,
9496
ServiceProxyModule,
9597
RootRoutingModule,
96-
HttpClientModule
98+
HttpClientModule,
99+
// TODO: is this necessary? https://material.angular.io/guide/getting-started#step-2-configure-animations
100+
NoopAnimationsModule
97101
],
98102
declarations: [
99103
RootComponent
@@ -110,7 +114,8 @@ export function getCurrentLanguage(): string {
110114
{
111115
provide: LOCALE_ID,
112116
useFactory: getCurrentLanguage
113-
}
117+
},
118+
{ provide: HAMMER_GESTURE_CONFIG, useClass: GestureConfig },
114119
],
115120
bootstrap: [RootComponent]
116121
})

angular/src/shared/shared.module.ts

Lines changed: 117 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,88 @@ import { AppRouteGuard } from './auth/auth-route-guard';
1111
import { MaterialInput } from 'shared/directives/material-input.directive';
1212
import { AbpPaginationControlsComponent } from './pagination/abp-pagination-controls.component';
1313
import { LocalizePipe } from '@shared/pipes/localize.pipe';
14-
14+
import { DragDropModule } from '@angular/cdk/drag-drop';
15+
import { ScrollingModule } from '@angular/cdk/scrolling';
16+
import { CdkTableModule } from '@angular/cdk/table';
17+
import { CdkTreeModule } from '@angular/cdk/tree';
18+
import {
19+
MatAutocompleteModule,
20+
MatBadgeModule,
21+
MatBottomSheetModule,
22+
MatButtonModule,
23+
MatButtonToggleModule,
24+
MatCardModule,
25+
MatCheckboxModule,
26+
MatChipsModule,
27+
MatDatepickerModule,
28+
MatDialogModule,
29+
MatDividerModule,
30+
MatExpansionModule,
31+
MatGridListModule,
32+
MatIconModule,
33+
MatInputModule,
34+
MatListModule,
35+
MatMenuModule,
36+
MatNativeDateModule,
37+
MatPaginatorModule,
38+
MatProgressBarModule,
39+
MatProgressSpinnerModule,
40+
MatRadioModule,
41+
MatRippleModule,
42+
MatSelectModule,
43+
MatSidenavModule,
44+
MatSliderModule,
45+
MatSlideToggleModule,
46+
MatSnackBarModule,
47+
MatSortModule,
48+
MatStepperModule,
49+
MatTableModule,
50+
MatTabsModule,
51+
MatToolbarModule,
52+
MatTooltipModule,
53+
MatTreeModule,
54+
} from '@angular/material';
1555
@NgModule({
1656
imports: [
1757
CommonModule,
1858
AbpModule,
1959
RouterModule,
20-
NgxPaginationModule
60+
NgxPaginationModule,
61+
MatAutocompleteModule,
62+
MatBadgeModule,
63+
MatBottomSheetModule,
64+
MatButtonModule,
65+
MatButtonToggleModule,
66+
MatCardModule,
67+
MatCheckboxModule,
68+
MatChipsModule,
69+
MatDatepickerModule,
70+
MatDialogModule,
71+
MatDividerModule,
72+
MatExpansionModule,
73+
MatGridListModule,
74+
MatIconModule,
75+
MatInputModule,
76+
MatListModule,
77+
MatMenuModule,
78+
MatNativeDateModule,
79+
MatPaginatorModule,
80+
MatProgressBarModule,
81+
MatProgressSpinnerModule,
82+
MatRadioModule,
83+
MatRippleModule,
84+
MatSelectModule,
85+
MatSidenavModule,
86+
MatSliderModule,
87+
MatSlideToggleModule,
88+
MatSnackBarModule,
89+
MatSortModule,
90+
MatStepperModule,
91+
MatTableModule,
92+
MatTabsModule,
93+
MatToolbarModule,
94+
MatTooltipModule,
95+
MatTreeModule,
2196
],
2297
declarations: [
2398
MaterialInput,
@@ -27,7 +102,46 @@ import { LocalizePipe } from '@shared/pipes/localize.pipe';
27102
exports: [
28103
MaterialInput,
29104
AbpPaginationControlsComponent,
30-
LocalizePipe
105+
LocalizePipe,
106+
CdkTableModule,
107+
CdkTreeModule,
108+
DragDropModule,
109+
MatAutocompleteModule,
110+
MatBadgeModule,
111+
MatBottomSheetModule,
112+
MatButtonModule,
113+
MatButtonToggleModule,
114+
MatCardModule,
115+
MatCheckboxModule,
116+
MatChipsModule,
117+
MatStepperModule,
118+
MatDatepickerModule,
119+
MatDialogModule,
120+
MatDividerModule,
121+
MatExpansionModule,
122+
MatGridListModule,
123+
MatIconModule,
124+
MatInputModule,
125+
MatListModule,
126+
MatMenuModule,
127+
MatNativeDateModule,
128+
MatPaginatorModule,
129+
MatProgressBarModule,
130+
MatProgressSpinnerModule,
131+
MatRadioModule,
132+
MatRippleModule,
133+
MatSelectModule,
134+
MatSidenavModule,
135+
MatSliderModule,
136+
MatSlideToggleModule,
137+
MatSnackBarModule,
138+
MatSortModule,
139+
MatTableModule,
140+
MatTabsModule,
141+
MatToolbarModule,
142+
MatTooltipModule,
143+
MatTreeModule,
144+
ScrollingModule,
31145
]
32146
})
33147
export class SharedModule {

0 commit comments

Comments
 (0)