feat: angular upgrade - 13.3.2 => 14.2.3
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { MutiplesComponent } from './components/mutiples/mutiples.component';
|
||||
import { MultiplesComponent } from './components/multiples/multiples.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: MutiplesComponent,
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
component: MultiplesComponent,
|
||||
},
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forRoot(routes)],
|
||||
exports: [RouterModule],
|
||||
imports: [RouterModule.forRoot(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class AppRoutingModule {}
|
||||
|
||||
@@ -6,7 +6,7 @@ import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
|
||||
import { AppRoutingModule } from './app-routing.module';
|
||||
import { AppComponent } from './app.component';
|
||||
import { MutiplesComponent } from './components/mutiples/mutiples.component';
|
||||
import { MultiplesComponent } from './components/multiples/multiples.component';
|
||||
|
||||
// AoT requires an exported function for factories
|
||||
export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
|
||||
@@ -14,7 +14,7 @@ export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
declarations: [AppComponent, MutiplesComponent],
|
||||
declarations: [AppComponent, MultiplesComponent],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
AppRoutingModule,
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#multiples {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 210px;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
color: #ffffff;
|
||||
font-weight: 900;
|
||||
|
||||
.container {
|
||||
background-color: #d47800e0;
|
||||
border-radius: 4px;
|
||||
padding: 20px;
|
||||
|
||||
form {
|
||||
display: flex;
|
||||
> * {
|
||||
margin: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
|
||||
import { MultiplesComponent } from './multiples.component';
|
||||
|
||||
describe('MultiplesComponent', () => {
|
||||
let component: MultiplesComponent;
|
||||
let fixture: ComponentFixture<MultiplesComponent>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [MultiplesComponent],
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(MultiplesComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,17 +1,19 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormControl, FormGroup } from '@angular/forms';
|
||||
import { FormControl, UntypedFormGroup } from '@angular/forms';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { WindowApiConst } from 'shared-lib';
|
||||
import { ElectronIpcService } from '../../services/electron-ipc.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-mutiples',
|
||||
templateUrl: './mutiples.component.html',
|
||||
styleUrls: ['./mutiples.component.scss'],
|
||||
selector: 'app-multiples',
|
||||
templateUrl: './multiples.component.html',
|
||||
styleUrls: ['./multiples.component.scss'],
|
||||
})
|
||||
export class MutiplesComponent implements OnInit {
|
||||
timesTableForm = new FormGroup({
|
||||
input: new FormControl(Math.round(Math.random() * 100) % 10),
|
||||
export class MultiplesComponent implements OnInit {
|
||||
timesTableForm = new UntypedFormGroup({
|
||||
input: new FormControl<number>(Math.round(Math.random() * 100) % 10, {
|
||||
nonNullable: true,
|
||||
}),
|
||||
});
|
||||
|
||||
multiples: number[] = [];
|
||||
@@ -1,23 +0,0 @@
|
||||
#multiples {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 210px;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
color: #ffffff;
|
||||
font-weight: 900;
|
||||
|
||||
.container {
|
||||
background-color: #d47800e0;
|
||||
border-radius: 4px;
|
||||
padding: 20px;
|
||||
|
||||
form {
|
||||
display: flex;
|
||||
> * {
|
||||
margin: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
|
||||
import { MutiplesComponent } from './mutiples.component';
|
||||
|
||||
describe('MutiplesComponent', () => {
|
||||
let component: MutiplesComponent;
|
||||
let fixture: ComponentFixture<MutiplesComponent>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ MutiplesComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(MutiplesComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -16,7 +16,7 @@ export class ElectronIpcService {
|
||||
}
|
||||
}
|
||||
|
||||
public receive<Out>(channel: string, func: (output: Out) => void): void {
|
||||
public receive<Out>(channel: string, callback: (output: Out) => void): void {
|
||||
if (this._api) {
|
||||
this._api.receive<Out>(channel, (output) => {
|
||||
console.log(`Received from main process channel [${channel}]`, output);
|
||||
@@ -25,7 +25,7 @@ export class ElectronIpcService {
|
||||
// doesn't recognize it needs to run change detection
|
||||
// Further details on SO : https://stackoverflow.com/a/49136353/11480016
|
||||
this.zone.run(() => {
|
||||
func(output);
|
||||
callback(output);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user