From 104dedcf21229890a7acb4cdf2a80307ced4508d Mon Sep 17 00:00:00 2001 From: Bob Goodearl Date: Sat, 6 Jul 2019 17:47:51 -0400 Subject: [PATCH] Added license, TodoListService - use BASE_URL-from weather_scope branch --- .gitignore | 5 ++++- .../src/app/fetch-data/fetch-data.component.ts | 1 + .../ClientApp/src/app/todo-list/todo-list.service.ts | 11 ++++++----- TodoSPA/ClientApp/src/main.ts | 4 +++- TodoSPASample.sln | 1 + _docs/TSS_DevNotes.md | 8 ++++++++ 6 files changed, 23 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 4ce6fdd..90b450d 100644 --- a/.gitignore +++ b/.gitignore @@ -337,4 +337,7 @@ ASALocalRun/ .localhistory/ # BeatPulse healthcheck temp database -healthchecksdb \ No newline at end of file +healthchecksdb + +# Ignore folders starting with _Local or _Local +_[Ll]ocal* diff --git a/TodoSPA/ClientApp/src/app/fetch-data/fetch-data.component.ts b/TodoSPA/ClientApp/src/app/fetch-data/fetch-data.component.ts index c120bef..2187844 100644 --- a/TodoSPA/ClientApp/src/app/fetch-data/fetch-data.component.ts +++ b/TodoSPA/ClientApp/src/app/fetch-data/fetch-data.component.ts @@ -9,6 +9,7 @@ export class FetchDataComponent { public forecasts: WeatherForecast[]; constructor(http: HttpClient, @Inject('BASE_URL') baseUrl: string) { + console.log("FetchDataComponent BASE_URL=[" + baseUrl + "]"); http.get(baseUrl + 'api/SampleData/WeatherForecasts').subscribe(result => { this.forecasts = result; }, error => console.error(error)); diff --git a/TodoSPA/ClientApp/src/app/todo-list/todo-list.service.ts b/TodoSPA/ClientApp/src/app/todo-list/todo-list.service.ts index ab26e68..7aca973 100644 --- a/TodoSPA/ClientApp/src/app/todo-list/todo-list.service.ts +++ b/TodoSPA/ClientApp/src/app/todo-list/todo-list.service.ts @@ -1,4 +1,4 @@ -import {Injectable} from "@angular/core"; +import { Injectable, Inject } from "@angular/core"; import {HttpClient} from "@angular/common/http"; import {Observable} from "rxjs"; import {TodoList} from "./todoList"; @@ -6,12 +6,13 @@ import { map, catchError } from 'rxjs/operators'; @Injectable() export class TodoListService { - static VER: string = "1.01"; + static VER: string = "1.02"; - private apiEndpoint: string = "https://localhost:44358/api/todo"; + private apiEndpoint: string = null; //"https://localhost:44358/api/todo"; - constructor(private http: HttpClient) { - console.log("todoListSvc constructor v=" + TodoListService.VER); + constructor(private http: HttpClient, @Inject('BASE_URL') baseUrl: string) { + console.log("todoListSvc constructor v=" + TodoListService.VER + " - baseUrl=[" + baseUrl + "]"); + this.apiEndpoint = baseUrl + "api/todo"; } getItems(): Observable { diff --git a/TodoSPA/ClientApp/src/main.ts b/TodoSPA/ClientApp/src/main.ts index a2f708c..b2af76f 100644 --- a/TodoSPA/ClientApp/src/main.ts +++ b/TodoSPA/ClientApp/src/main.ts @@ -5,7 +5,9 @@ import { AppModule } from './app/app.module'; import { environment } from './environments/environment'; export function getBaseUrl() { - return document.getElementsByTagName('base')[0].href; + let baseUrl: string = document.getElementsByTagName('base')[0].href; + console.log("main - baseUrl=[" + baseUrl + "]"); + return baseUrl; } const providers = [ diff --git a/TodoSPASample.sln b/TodoSPASample.sln index 2ffac74..fa3ebea 100644 --- a/TodoSPASample.sln +++ b/TodoSPASample.sln @@ -8,6 +8,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5EEC8370-5BFC-4D96-9C26-FF9ECD501716}" ProjectSection(SolutionItems) = preProject _docs\AzureADResources.md = _docs\AzureADResources.md + LICENSE = LICENSE _docs\MS_Identity_Web.md = _docs\MS_Identity_Web.md readme.md = readme.md _docs\TSS_DevNotes.md = _docs\TSS_DevNotes.md diff --git a/_docs/TSS_DevNotes.md b/_docs/TSS_DevNotes.md index cbfff8e..248aebf 100644 --- a/_docs/TSS_DevNotes.md +++ b/_docs/TSS_DevNotes.md @@ -6,6 +6,14 @@ Dev Notes + + 7/6/2019bg + + Added license.
+ Picked up some changes from weather_scope branch. + TodoListService - use BASE_URL to set up URL for api/todo.
+ + 7/2/2019bg