@ -15,7 +15,7 @@ export class BackendService {
|
||||
|
||||
getAll(type: Type<any>): PromiseLike<any[]> {
|
||||
if (type === Hero) {
|
||||
// TODO get from the database
|
||||
// TODO: get from the database
|
||||
return Promise.resolve<Hero[]>(HEROES);
|
||||
}
|
||||
let err = new Error('Cannot get object of this type');
|
||||
|
@ -8,7 +8,7 @@ import { MinimalLogger } from './minimal-logger.service';
|
||||
@Component({
|
||||
selector: 'app-hero-of-the-month',
|
||||
templateUrl: './hero-of-the-month.component.html',
|
||||
// Todo: move this aliasing, `useExisting` provider to the AppModule
|
||||
// TODO: move this aliasing, `useExisting` provider to the AppModule
|
||||
providers: [{ provide: MinimalLogger, useExisting: LoggerService }]
|
||||
})
|
||||
export class HeroOfTheMonthComponent {
|
||||
|
@ -5,7 +5,7 @@ import { Hero } from './hero';
|
||||
@Injectable()
|
||||
export class HeroService {
|
||||
|
||||
// TODO move to database
|
||||
// TODO: move to database
|
||||
private heroes: Array<Hero> = [
|
||||
new Hero(1, 'RubberMan', 'Hero of many talents', '123-456-7899'),
|
||||
new Hero(2, 'Magma', 'Hero of all trades', '555-555-5555'),
|
||||
|
@ -151,7 +151,7 @@ export class BethComponent implements Parent {
|
||||
// #docregion alex-1
|
||||
})
|
||||
// #enddocregion alex-1
|
||||
// Todo: Add `... implements Parent` to class signature
|
||||
// TODO: Add `... implements Parent` to class signature
|
||||
// #docregion alex-1
|
||||
// #docregion alex-class-signature
|
||||
export class AlexComponent extends Base
|
||||
|
@ -7,7 +7,7 @@ export class User {
|
||||
public isAuthorized = false) { }
|
||||
}
|
||||
|
||||
// Todo: get the user; don't 'new' it.
|
||||
// TODO: get the user; don't 'new' it.
|
||||
let alice = new User('Alice', true);
|
||||
let bob = new User('Bob', false);
|
||||
|
||||
|
@ -8,8 +8,8 @@ import { TextboxQuestion } from './question-textbox';
|
||||
@Injectable()
|
||||
export class QuestionService {
|
||||
|
||||
// Todo: get from a remote source of question metadata
|
||||
// Todo: make asynchronous
|
||||
// TODO: get from a remote source of question metadata
|
||||
// TODO: make asynchronous
|
||||
getQuestions() {
|
||||
|
||||
let questions: QuestionBase<any>[] = [
|
||||
|
@ -14,7 +14,7 @@ export class UploadInterceptor implements HttpInterceptor {
|
||||
if (req.url.indexOf('/upload/file') === -1) {
|
||||
return next.handle(req);
|
||||
}
|
||||
const delay = 300; // Todo: inject delay?
|
||||
const delay = 300; // TODO: inject delay?
|
||||
return createUploadEvents(delay);
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ export class HeroListComponent implements OnInit {
|
||||
getHeroes() {
|
||||
this.isLoading = true;
|
||||
this.heroes = this.heroService.getHeroes()
|
||||
// Todo: error handling
|
||||
// TODO: error handling
|
||||
.pipe(finalize(() => this.isLoading = false));
|
||||
this.selectedHero = undefined;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// #docplaster
|
||||
// #docregion
|
||||
// TODO SOMEDAY: Feature Componetized like HeroCenter
|
||||
// TODO: Feature Componetized like HeroCenter
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
|
@ -1,6 +1,6 @@
|
||||
// #docplaster
|
||||
// #docregion
|
||||
// TODO SOMEDAY: Feature Componetized like CrisisCenter
|
||||
// TODO: Feature Componetized like CrisisCenter
|
||||
// #docregion rxjs-imports
|
||||
import { Observable } from 'rxjs';
|
||||
import { switchMap } from 'rxjs/operators';
|
||||
|
@ -15,7 +15,7 @@ describe ('HeroesService (with spies)', () => {
|
||||
let heroService: HeroService;
|
||||
|
||||
beforeEach(() => {
|
||||
// Todo: spy on other methods too
|
||||
// TODO: spy on other methods too
|
||||
httpClientSpy = jasmine.createSpyObj('HttpClient', ['get']);
|
||||
heroService = new HeroService(<any> httpClientSpy);
|
||||
});
|
||||
|
@ -26,7 +26,7 @@ export class HeroService {
|
||||
// #docregion getHeroes, getHeroes-1
|
||||
getHeroes(): Observable<Hero[]> {
|
||||
// #enddocregion getHeroes-1
|
||||
// Todo: send the message _after_ fetching the heroes
|
||||
// TODO: send the message _after_ fetching the heroes
|
||||
this.messageService.add('HeroService: fetched heroes');
|
||||
// #docregion getHeroes-1
|
||||
return of(HEROES);
|
||||
|
@ -12,14 +12,14 @@ export class HeroService {
|
||||
constructor(private messageService: MessageService) { }
|
||||
|
||||
getHeroes(): Observable<Hero[]> {
|
||||
// Todo: send the message _after_ fetching the heroes
|
||||
// TODO: send the message _after_ fetching the heroes
|
||||
this.messageService.add('HeroService: fetched heroes');
|
||||
return of(HEROES);
|
||||
}
|
||||
|
||||
// #docregion getHero
|
||||
getHero(id: number): Observable<Hero> {
|
||||
// Todo: send the message _after_ fetching the hero
|
||||
// TODO: send the message _after_ fetching the hero
|
||||
this.messageService.add(`HeroService: fetched hero id=${id}`);
|
||||
return of(HEROES.find(hero => hero.id === id));
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ export class ApiListComponent implements OnInit {
|
||||
this.initializeSearchCriteria();
|
||||
}
|
||||
|
||||
// Todo: may need to debounce as the original did
|
||||
// TODO: may need to debounce as the original did
|
||||
// although there shouldn't be any perf consequences if we don't
|
||||
setQuery(query: string) {
|
||||
this.setSearchCriteria({query: (query || '').toLowerCase().trim() });
|
||||
|
@ -75,7 +75,7 @@ export class ApiService implements OnDestroy {
|
||||
.subscribe(
|
||||
sections => this.sectionsSubject.next(sections),
|
||||
(err: HttpErrorResponse) => {
|
||||
// Todo: handle error
|
||||
// TODO: handle error
|
||||
this.logger.error(err);
|
||||
throw err; // rethrow for now.
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ export class LocationService {
|
||||
swUpdates.updateActivated.subscribe(() => this.swUpdateActivated = true);
|
||||
}
|
||||
|
||||
// TODO?: ignore if url-without-hash-or-search matches current location?
|
||||
// TODO: ignore if url-without-hash-or-search matches current location?
|
||||
go(url: string|null|undefined) {
|
||||
if (!url) { return; }
|
||||
url = this.stripSlashes(url);
|
||||
|
Reference in New Issue
Block a user