Skip to main content

Set variable

Makes sure that @ng-apimock/core will add or update the variable.

Usage

setVariable(key, value);

Parameters

NameTypeDetails
keystringthe key
valueanythe value

Example

setVariable('now', new Date().getTime());

Executing this will add a variable with key now and value the current date time. This variable will be used to interpolated with the mock response.