Skip to content

Commit 49b3bd9

Browse files
committed
migrate angular 8
1 parent 0b551d0 commit 49b3bd9

27 files changed

+8837
-6552
lines changed

src/angular/browserslist

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2+
# For additional information regarding the format and rule options, please see:
3+
# https://github.com/browserslist/browserslist#queries
4+
5+
# You can see what browsers were selected by your queries by running:
6+
# npx browserslist
7+
8+
> 0.5%
9+
last 2 versions
10+
Firefox ESR
11+
not dead
12+
not IE 9-11 # For IE 9-11 support, remove 'not'.

src/angular/package-lock.json

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

src/angular/package.json

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"ng": "ng",
77
"start": "ng serve --proxy-config proxy.conf.json",
88
"build": "ng build --prod",
9+
"buildwatch": "ng build --watch",
910
"test": "ng test",
1011
"lint": "ng lint",
1112
"e2e": "ng e2e",
@@ -15,42 +16,41 @@
1516
},
1617
"private": true,
1718
"dependencies": {
18-
"@angular/animations": "^6.0.3",
19-
"@angular/common": "^6.0.3",
20-
"@angular/compiler": "^6.0.3",
21-
"@angular/core": "^6.0.3",
22-
"@angular/forms": "^6.0.3",
23-
"@angular/http": "^6.0.3",
24-
"@angular/platform-browser": "^6.0.3",
25-
"@angular/platform-browser-dynamic": "^6.0.3",
26-
"@angular/router": "^6.0.3",
27-
"@fortawesome/fontawesome-free-webfonts": "^1.0.9",
28-
"@ng-bootstrap/ng-bootstrap": "^2.0.0",
29-
"@ngrx/effects": "^6.0.1",
30-
"@ngrx/entity": "^6.0.1",
31-
"@ngrx/store": "^6.0.1",
32-
"@ngrx/store-devtools": "^6.0.1",
33-
"awesome-bootstrap-checkbox": "^1.0.1",
34-
"bootstrap": "^4.1.1",
19+
"@angular/animations": "^8.2.14",
20+
"@angular/common": "^8.2.14",
21+
"@angular/compiler": "^8.2.14",
22+
"@angular/core": "^8.2.14",
23+
"@angular/forms": "^8.2.14",
24+
"@angular/platform-browser": "^8.2.14",
25+
"@angular/platform-browser-dynamic": "^8.2.14",
26+
"@angular/router": "^8.2.14",
27+
"@fortawesome/angular-fontawesome": "^0.5.0",
28+
"@fortawesome/fontawesome-svg-core": "^1.2.27",
29+
"@fortawesome/free-solid-svg-icons": "^5.12.1",
30+
"@ng-bootstrap/ng-bootstrap": "^5.3.0",
31+
"@ngrx/data": "^8.6.0",
32+
"@ngrx/effects": "^8.6.0",
33+
"@ngrx/entity": "^8.6.0",
34+
"@ngrx/store": "^8.6.0",
35+
"@ngrx/store-devtools": "^8.6.0",
36+
"bootstrap": "^4.4.1",
3537
"core-js": "^2.5.6",
36-
"ngrx-data": "^6.0.2-beta.9",
37-
"ngx-spinner": "^6.0.0",
38-
"ngx-toastr": "^8.8.0",
39-
"rxjs": "^6.2.0",
38+
"ngx-spinner": "^8.1.0",
39+
"ngx-toastr": "^11.3.3",
40+
"rxjs": "^6.5.4",
4041
"rxjs-compat": "^6.1.0",
41-
"zone.js": "^0.8.19"
42+
"zone.js": "~0.9.1"
4243
},
4344
"devDependencies": {
44-
"@angular-devkit/build-angular": "~0.6.3",
45-
"@angular/cli": "~6.0.3",
46-
"@angular/compiler-cli": "^6.0.3",
47-
"@angular/language-service": "^6.0.3",
48-
"@compodoc/compodoc": "^1.1.3",
49-
"@ngrx/schematics": "^6.0.1",
45+
"@angular-devkit/build-angular": "~0.803.25",
46+
"@angular/cli": "~8.3.25",
47+
"@angular/compiler-cli": "^8.2.14",
48+
"@angular/language-service": "^8.2.14",
49+
"@ngrx/schematics": "^8.6.0",
5050
"@types/jasmine": "^2.8.7",
5151
"@types/jasminewd2": "~2.0.3",
5252
"@types/node": "^6.0.109",
53-
"codelyzer": "^4.3.0",
53+
"codelyzer": "^5.0.1",
5454
"jasmine-core": "~2.8.0",
5555
"jasmine-spec-reporter": "~4.2.1",
5656
"json-server": "^0.15.1",
@@ -62,7 +62,7 @@
6262
"protractor": "^5.3.2",
6363
"ts-node": "~4.1.0",
6464
"tslint": "~5.9.1",
65-
"typescript": "^2.7.2",
65+
"typescript": "^3.5.3",
6666
"worker-loader": "^1.1.1"
6767
}
6868
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
12
import { NgModule } from '@angular/core';
23
import { CommonModule } from '@angular/common';
34
import { AdminRoutingModule } from './admin-routing.module';
45
import { AdminComponent } from './admin.component';
56
import { UploadComponent } from './upload/upload.component';
6-
import {FormsModule, ReactiveFormsModule} from "@angular/forms";
7+
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
78

89
@NgModule({
9-
imports: [CommonModule, AdminRoutingModule, FormsModule, ReactiveFormsModule],
10+
imports: [CommonModule, AdminRoutingModule, FormsModule, ReactiveFormsModule, FontAwesomeModule],
1011
declarations: [AdminComponent, UploadComponent]
1112
})
1213
export class AdminModule {}

src/angular/src/app/admin/upload/upload.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</div>
88
</div>
99
<button type="submit" class="btn btn-primary" value="Upload">
10-
<i class="fas fa-upload"></i> Submit
10+
<fa-icon icon="upload"></fa-icon> Submit
1111
</button>
1212

1313
</form>

src/angular/src/app/app.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { UtilsService } from './services/utils.service';
12
import { Component, ChangeDetectionStrategy } from '@angular/core';
23
import { ToastService } from './services/toast.service';
34

@@ -9,6 +10,9 @@ import { ToastService } from './services/toast.service';
910
})
1011
export class AppComponent {
1112
constructor(
13+
private utilsService: UtilsService,
1214
private toastService: ToastService // create an instance of the service that intercepts $entities actions
13-
) {}
15+
) {
16+
this.utilsService.initIcons();
17+
}
1418
}

src/angular/src/app/app.module.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { ToastrModule } from 'ngx-toastr';
1313
import { TodoModule } from './todo/todo.module';
1414
import { AppRoutingModule } from './app-routing/app-routing.module';
1515
import { AdminModule } from './admin/admin.module';
16+
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
1617

1718
@NgModule({
1819
declarations: [AppComponent],
@@ -26,10 +27,11 @@ import { AdminModule } from './admin/admin.module';
2627
BrowserModule,
2728
AppStoreModule,
2829
ServicesModule,
29-
NgbModule.forRoot(),
30+
NgbModule,
31+
FontAwesomeModule,
3032
BrowserAnimationsModule, // required animations module
3133
ToastrModule.forRoot(),
32-
AppRoutingModule // ToastrModule added
34+
AppRoutingModule
3335
],
3436
providers: [],
3537
bootstrap: [AppComponent]

src/angular/src/app/comp/comp.module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
12
import { NgModule } from '@angular/core';
23
import { CommonModule } from '@angular/common';
34
import { FaInputComponent } from './fa-input/fa-input.component';
@@ -10,7 +11,7 @@ import { RouterModule } from '@angular/router';
1011
* Module des composants annexes non liés aux routes
1112
*/
1213
@NgModule({
13-
imports: [CommonModule, RouterModule],
14+
imports: [CommonModule, RouterModule, FontAwesomeModule],
1415
declarations: [
1516
FaInputComponent,
1617
HelloComponent,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<i class="fas mr-2" [ngClass]="classes"></i>
1+
<fa-icon class="mr-2" [icon]="icon"></fa-icon>
22
<ng-content></ng-content>
33
<!--input #input (focus)="inputFocus = true" (blur)="inputFocus = false" (keyup)="value.emit(input.value)"-->

src/angular/src/app/comp/fa-input/fa-input.component.ts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
EventEmitter,
55
HostBinding,
66
Input,
7-
OnInit,
87
Output
98
} from '@angular/core';
109
import { InputRefDirective } from '../../shared/input-ref.directive';
@@ -14,27 +13,15 @@ import { InputRefDirective } from '../../shared/input-ref.directive';
1413
templateUrl: './fa-input.component.html',
1514
styleUrls: ['./fa-input.component.scss']
1615
})
17-
export class FaInputComponent implements OnInit {
16+
export class FaInputComponent {
1817
@Input() icon: string;
1918
@Output() value = new EventEmitter<string>();
2019
inputFocus = false;
2120

22-
@ContentChild(InputRefDirective) input: InputRefDirective;
23-
24-
constructor() {}
25-
26-
ngOnInit() {}
27-
28-
get classes() {
29-
const cssClasses = {};
30-
cssClasses['fa-' + this.icon] = true;
31-
return cssClasses;
32-
}
21+
@ContentChild(InputRefDirective, {static: false}) input: InputRefDirective;
3322

3423
@HostBinding('class.focus')
3524
get focus() {
36-
// console.log(this.inputFocus);
37-
// return this.inputFocus;
3825
return this.input ? this.input.focus : false;
3926
}
4027
}

0 commit comments

Comments
 (0)