Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/odata.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Http, Response } from '@angular/http';
import { Observable } from 'rxjs/rx';
import { Observable } from 'rxjs/Rx';
import { ODataConfiguration } from './config';
import { ODataQuery } from './query';
import { GetOperation } from './operation';
Expand Down
4 changes: 2 additions & 2 deletions build/odata.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/operation.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { URLSearchParams, Http, Response, RequestOptions } from '@angular/http';
import { Observable } from 'rxjs/rx';
import { Observable } from 'rxjs/Rx';
import { ODataConfiguration } from './config';
export declare abstract class ODataOperation<T> {
protected _typeName: string;
Expand Down
4 changes: 2 additions & 2 deletions build/operation.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/query.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Http } from '@angular/http';
import { Observable } from 'rxjs/rx';
import { Observable } from 'rxjs/Rx';
import { ODataConfiguration } from './config';
import { ODataOperation } from './operation';
export declare class PagedResult<T> {
Expand Down
10 changes: 5 additions & 5 deletions build/query.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/query.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/odata.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { URLSearchParams, Http, Response, Headers, RequestOptions } from '@angular/http';
import { Observable, Operator } from 'rxjs/rx';
import { Observable, Operator } from 'rxjs/Rx';
import { ODataConfiguration } from './config';
import { ODataQuery } from './query';
import { GetOperation } from './operation';
Expand Down
2 changes: 1 addition & 1 deletion src/operation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { URLSearchParams, Http, Response, RequestOptions } from '@angular/http';
import { Observable, Operator } from 'rxjs/rx';
import { Observable, Operator } from 'rxjs/Rx';
import { ODataConfiguration } from './config';

export abstract class ODataOperation<T> {
Expand Down
6 changes: 3 additions & 3 deletions src/query.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { URLSearchParams, Http, Response } from '@angular/http';
import { Observable, Operator, Subject } from 'rxjs/rx';
import { Observable, Operator, Subject } from 'rxjs/Rx';
import { ODataConfiguration } from './config';
import { ODataOperation } from './operation';

Expand Down Expand Up @@ -41,7 +41,7 @@ export class ODataQuery<T> extends ODataOperation<T> {
public Exec(): Observable<Array<T>> {
let params = this.getQueryParams();
let config = this.config;
return this.http.get(this.buildResourceURL(), { search: params })
return this.http.get(this.buildResourceURL(), { search: params, headers: this.config.requestOptions.headers })
.map(res => this.extractArrayData(res, config))
.catch((err: any, caught: Observable<Array<T>>) => {
if (this.config.handleError) this.config.handleError(err, caught);
Expand All @@ -54,7 +54,7 @@ export class ODataQuery<T> extends ODataOperation<T> {
params.set('$count', 'true'); // OData v4 only
let config = this.config;

return this.http.get(this.buildResourceURL(), { search: params })
return this.http.get(this.buildResourceURL(), { search: params, headers: this.config.requestOptions.headers })
.map(res => this.extractArrayDataWithCount(res, config))
.catch((err: any, caught: Observable<PagedResult<T>>) => {
if (this.config.handleError) this.config.handleError(err, caught);
Expand Down