Answering my own question, I found that I need to use the link to the exported function, therefore, using:
providers: [ { provide: APP_BASE_HREF, useValue: '/order/' }, { provide: XSRFStrategy, useValue: cookieStrategy }, { provide: RequestOptions, useClass: DefaultRequestOptions } ], export function cookieStrategy() { return new CookieXSRFStrategy('csrftoken', 'X-CSRFToken'); }
compiled well, but gave a runtime error: as
ERROR TypeError: this._xsrfStrategy.configureRequest is not a function
changing useValue to useFactory fixes the problem
providers: [ { provide: APP_BASE_HREF, useValue: '/order/' }, { provide: XSRFStrategy, useFactory: cookieStrategy }, { provide: RequestOptions, useClass: DefaultRequestOptions } ],
source share