Skip to content

Mixing in data for every request #65

@ghost

Description

Hi There,

I have some data relating to authorization that needs to be included in every ajax request. How would I include this in a base class without having to include it in every single one of my models.

For example:

client_id: 'myAppId'

should be part of every ajax request.

I had a look at ajaxConfig .. but this only lets me set headers and and xhr options, but does not seem to provide a way to include data.

I also looked at the "request" module on npm, but even there I couldn't find a neat way to always inject some data into every request.

In AngularJS I saw an example of an "authentication injector service" ... how would I achieve this with Ampersand?

Thanks,

Oliver

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions