Improve this Doc View Source

The `$templateRequest` service downloads the provided template using `$http` and, upon success, stores the contents inside of `$templateCache`. If the HTTP request fails or the response data of the HTTP request is empty, a `$compile` error will be thrown (the exception can be thwarted by setting the 2nd parameter of the function to true).

## Usage

`$templateRequest(tpl, [ignoreRequestError]);`

### Arguments

Param | Type | Details
--- | --- | ---
tpl | string | The HTTP request template URL
ignoreRequestError (optional) | boolean | Whether or not to ignore the exception when the request fails or the template is empty

### Returns

Promise | the HTTP Promise for the given.

## Properties

- ### `totalPendingRequests`

  number | total amount of pending template requests being downloaded.