diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..cf68007 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,36 @@ +{ + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md + "version": "0.2.0", + "configurations": [ + { + "name": ".NET Core Launch (web)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceFolder}/Back/skydiveLogs-api/bin/Debug/netcoreapp2.2/skydiveLogs-api.dll", + "args": [], + "cwd": "${workspaceFolder}/Back/skydiveLogs-api", + "stopAtEntry": false, + // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser + "serverReadyAction": { + "action": "openExternally", + "pattern": "^\\s*Now listening on:\\s+(https?://\\S+)" + }, + "env": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "sourceFileMap": { + "/Views": "${workspaceFolder}/Views" + } + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach", + "processId": "${command:pickProcess}" + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..4f04071 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,42 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/Back/skydiveLogs-api/skydiveLogs-api.csproj", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "publish", + "command": "dotnet", + "type": "process", + "args": [ + "publish", + "${workspaceFolder}/Back/skydiveLogs-api/skydiveLogs-api.csproj", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "watch", + "command": "dotnet", + "type": "process", + "args": [ + "watch", + "run", + "${workspaceFolder}/Back/skydiveLogs-api/skydiveLogs-api.csproj", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/Front/skydivelogs-app/src/app/app.module.ts b/Front/skydivelogs-app/src/app/app.module.ts index 6da5ba7..c34a456 100644 --- a/Front/skydivelogs-app/src/app/app.module.ts +++ b/Front/skydivelogs-app/src/app/app.module.ts @@ -8,23 +8,15 @@ import { ListOfJumpsComponent } from './list-of-jumps/list-of-jumps.component'; import { ListOfDzsComponent } from './list-of-dzs/list-of-dzs.component'; import { NewJumpComponent } from './new-jump/new-jump.component'; +import { ServiceApi } from '../services/serviceApi'; +import { HttpClientModule } from '@angular/common/http'; + const appRoutes: Routes = [ { path: 'summary', component: SummaryComponent }, { path: 'jumpsList', component: ListOfJumpsComponent }, { path: 'dz', component: ListOfDzsComponent }, { path: 'newjump', component: NewJumpComponent } - // { path: 'hero/:id', component: HeroDetailComponent }, - // { - // path: 'heroes', - // component: HeroListComponent, - // data: { title: 'Heroes List' } - // }, - // { path: '', - // redirectTo: '/heroes', - // pathMatch: 'full' - // }, - // { path: '**', component: PageNotFoundComponent } ]; @@ -41,9 +33,10 @@ const appRoutes: Routes = [ appRoutes, { enableTracing: true } // <-- debugging purposes only ), - BrowserModule + BrowserModule, ], - providers: [], + exports: [HttpClientModule], + providers: [ServiceApi], bootstrap: [AppComponent] }) export class AppModule { } diff --git a/Front/skydivelogs-app/src/app/list-of-dzs/list-of-dzs.component.html b/Front/skydivelogs-app/src/app/list-of-dzs/list-of-dzs.component.html index abf7ac4..736e612 100644 --- a/Front/skydivelogs-app/src/app/list-of-dzs/list-of-dzs.component.html +++ b/Front/skydivelogs-app/src/app/list-of-dzs/list-of-dzs.component.html @@ -1,3 +1,11 @@

list-of-dzs works!

+ + + + + + + +
{{ dropZone.Id }}{{ dropZone.Name }}
diff --git a/Front/skydivelogs-app/src/app/list-of-dzs/list-of-dzs.component.ts b/Front/skydivelogs-app/src/app/list-of-dzs/list-of-dzs.component.ts index 2b33c25..02632f9 100644 --- a/Front/skydivelogs-app/src/app/list-of-dzs/list-of-dzs.component.ts +++ b/Front/skydivelogs-app/src/app/list-of-dzs/list-of-dzs.component.ts @@ -12,16 +12,15 @@ import { ServiceApi } from '../../services/serviceApi'; export class ListOfDzsComponent implements OnInit { public listOfDropZones: Array; - constructor(private serviceApi: ServiceApi) { } + constructor(private serviceApi: ServiceApi) { + } ngOnInit() { + this.getListOfDropZones(); } getListOfDropZones() { this.serviceApi.getListOfDropZones() - .subscribe((data: DropZoneResp) => this.listOfDropZones = { - heroesUrl: data['heroesUrl'], - textfile: data['textfile'] - }); + .subscribe((data: Array) => this.listOfDropZones = data); } } diff --git a/Front/skydivelogs-app/src/services/serviceApi.ts b/Front/skydivelogs-app/src/services/serviceApi.ts index cf81696..405c333 100644 --- a/Front/skydivelogs-app/src/services/serviceApi.ts +++ b/Front/skydivelogs-app/src/services/serviceApi.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; +import { HttpClient, HttpHeaders } from '@angular/common/http'; import { DropZoneResp } from '../models/dropzone'; @Injectable() @@ -7,6 +7,12 @@ export class ServiceApi { constructor(private http: HttpClient) { } public getListOfDropZones() { - return this.http.get('http://localhost:1234/api/DropZone'); + const httpOptions = { + headers: new HttpHeaders({ + 'Access-Control-Allow-Origin': 'https://localhost:44344', + }) + }; + + return this.http.get>('https://localhost:44344/api/DropZone', httpOptions); } }