Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
Part of #13 - renamed ApiUrl to ApiMapper
Browse files Browse the repository at this point in the history
  • Loading branch information
michadvorak-cen38289 committed Apr 21, 2017
1 parent abfe651 commit e2f4a3d
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/api-location.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { Location } from '@angular/common';
import { ApiUrl } from './api-url';
import { ApiMapper } from './api-url';
import { normalizeUrl } from './normalize';
import { NavigationHandler } from './navigation-handler';

Expand All @@ -15,7 +15,7 @@ export class ApiLocation implements NavigationHandler {

private urlValue: string;

constructor(private apiUrlService: ApiUrl,
constructor(private apiUrlService: ApiMapper,
private location: Location) {
this.location.subscribe(() => this.onLocationChanged());
this.onLocationChanged();
Expand Down
2 changes: 1 addition & 1 deletion src/api-url.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { async, TestBed } from '@angular/core/testing';

describe('ApiUrl', () => {
describe('ApiMapper', () => {

beforeEach(async(() => {

Expand Down
2 changes: 1 addition & 1 deletion src/api-url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const APP_API_PREFIX = new InjectionToken<string>('APP_API_PREFIX');
* It maps view URLs to API and vice versa.
*/
@Injectable()
export class ApiUrl {
export class ApiMapper {
/**
* API URL prefix. It's absolute URL, includes base href (if applicable).
*/
Expand Down
4 changes: 2 additions & 2 deletions src/directives/api-link.directive.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Directive, Input, HostBinding } from '@angular/core';
import { Location } from '@angular/common';
import { ResourceViewRegistry } from '../resource-view-registry';
import { ApiUrl } from '../api-url';
import { ApiMapper } from '../api-url';


/**
Expand All @@ -18,7 +18,7 @@ export class ApiLinkDirective {

private url: string|null;

constructor(private apiUrl: ApiUrl,
constructor(private apiUrl: ApiMapper,
private location: Location,
private dataRouteRegistry: ResourceViewRegistry) {
}
Expand Down
4 changes: 2 additions & 2 deletions src/directives/resource-link-with-href.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Component, DebugElement } from '@angular/core';
import { ResourceViewRegistry } from '../resource-view-registry';
import { TargetType } from './resource-link';
import { Location } from '@angular/common';
import { ApiUrl, APP_API_PREFIX } from '../api-url';
import { ApiMapper, APP_API_PREFIX } from '../api-url';
import { ViewData } from '../view-data';
import { NavigationHandler } from '../navigation-handler';
import { Headers } from '@angular/http';
Expand Down Expand Up @@ -51,7 +51,7 @@ describe(ResourceLinkWithHrefDirective.name, () => {
provide: APP_API_PREFIX,
useValue: API_PREFIX
},
ApiUrl,
ApiMapper,
ApiLocation,
]
});
Expand Down
4 changes: 2 additions & 2 deletions src/directives/resource-link-with-href.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Directive, OnChanges, HostBinding, Input, Optional, HostListener } from '@angular/core';
import { Location } from '@angular/common';
import { TargetType, TARGET_SELF, TARGET_TOP } from './resource-link';
import { ApiUrl } from '../api-url';
import { ApiMapper } from '../api-url';
import { ResourceViewRegistry } from '../resource-view-registry';
import { ViewData } from '../view-data';
import { supportsNavigation } from '../navigation-handler';
Expand All @@ -15,7 +15,7 @@ export class ResourceLinkWithHrefDirective implements OnChanges {
@Input() target?: TargetType;
@Input() external = false;

constructor(private apiUrl: ApiUrl,
constructor(private apiUrl: ApiMapper,
private location: Location,
private resourceViewRegistry: ResourceViewRegistry,
@Optional() private view?: ViewData<any>) {
Expand Down
4 changes: 2 additions & 2 deletions src/directives/resource-link.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Component, DebugElement } from '@angular/core';
import { ResourceViewRegistry } from '../resource-view-registry';
import { ResourceLinkDirective, TargetType } from './resource-link';
import { Location } from '@angular/common';
import { ApiUrl, APP_API_PREFIX } from '../api-url';
import { ApiMapper, APP_API_PREFIX } from '../api-url';
import { ViewData } from '../view-data';
import { NavigationHandler } from '../navigation-handler';
import { Headers } from '@angular/http';
Expand Down Expand Up @@ -49,7 +49,7 @@ describe(ResourceLinkDirective.name, () => {
provide: APP_API_PREFIX,
useValue: API_PREFIX
},
ApiUrl,
ApiMapper,
ApiLocation,
]
});
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export { ResourceRouterModule, ResourceRouterOptions, RESOURCE_ROUTER_CONFIGURAT
export { ViewData } from './view-data';
export { ViewDataLoader, HttpViewDataLoader, DefaultHttpViewDataLoader } from './view-data-loader';
export { ViewDef, Data, StatusType } from './view-definition';
export { ApiUrl, APP_API_PREFIX } from './api-url';
export { ApiMapper, APP_API_PREFIX } from './api-url';
export { ApiLocation } from './api-location';
export { ResourceViewRegistry, RESOURCE_VIEWS, TYPE_QUALITY_EVALUATOR } from './resource-view-registry'
export { ResourceOutletComponent } from './directives/resource-outlet';
Expand Down
4 changes: 2 additions & 2 deletions src/resource-router-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
Type
} from '@angular/core';
import { HttpModule } from '@angular/http';
import { ApiUrl, APP_API_PREFIX } from './api-url';
import { ApiMapper, APP_API_PREFIX } from './api-url';
import { ApiLocation } from './api-location';
import { ContentTypeStrategy, ViewTypeStrategy } from './view-type-strategy';
import { RESOURCE_VIEWS, ResourceViewRegistry } from './resource-view-registry';
Expand Down Expand Up @@ -98,7 +98,7 @@ export class ResourceRouterModule {
]
},
Location,
ApiUrl,
ApiMapper,
ApiLocation,
ResourceViewRegistry,
{
Expand Down

0 comments on commit e2f4a3d

Please sign in to comment.