Home Reference Source Repository
import $Response from 'angie/src/services/$Response.js'
public class | since 0.4.0 | source

$Response

You can directly use instance of this class. $Response

The $Response class controls all of the content contained in the response from the Angie application. This is an extended NodeJS http/https createServer response and is responsible for storing this response and the content associated with the response. It can be required using a module import, but probably should not be unless it is being subclassed for a dependency package. It can also be used as an injected provider using $request.

Example:

$Injector.get('$response');

Constructor Summary

Public Constructor
public

constructor(response: *)

Member Summary

Public Members
public

Method Summary

Public Methods
public

header(param: string, param: string): *

Sets a header on the instance's encapsulation of NodeJS response. This function performs no safe checks on the headers.

since 0.4.4

Public Constructors

public constructor(response: *) source

Params:

NameTypeAttributeDescription
response *

Public Members

public response: * source

Public Methods

public header(param: string, param: string): * since 0.4.4 source

Sets a header on the instance's encapsulation of NodeJS response. This function performs no safe checks on the headers.

Params:

NameTypeAttributeDescription
param string
  • optional
  • default: ''

k The name of the header

param string
  • optional
  • default: ''

v The value of the header

Return:

*

Example:

new $Response(res).header('X-Frame-Options', 'SAMEORIGIN');