Skip to content

Commit 6de0821

Browse files
rjametIgorMinar
authored andcommitted
docs($templateRequest): update the description with caching changes
The previous changes to $templateRequest were not documented, they now are.
1 parent 3c6e8ce commit 6de0821

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/ng/templateRequest.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ var $compileMinErr = minErr('$compile');
77
* @name $templateRequest
88
*
99
* @description
10-
* The `$templateRequest` service downloads the provided template using `$http` and, upon success,
11-
* stores the contents inside of `$templateCache`. If the HTTP request fails or the response data
12-
* of the HTTP request is empty, a `$compile` error will be thrown (the exception can be thwarted
13-
* by setting the 2nd parameter of the function to true).
10+
* The `$templateRequest` service runs security checks then downloads the provided template using
11+
* `$http` and, upon success, stores the contents inside of `$templateCache`. If the HTTP request
12+
* fails or the response data of the HTTP request is empty, a `$compile` error will be thrown (the
13+
* exception can be thwarted by setting the 2nd parameter of the function to true). Note that the
14+
* contents of `$templateCache` are trusted, so the call to `$sce.getTrustedUrl(tpl)` is omitted
15+
* when `tpl` is of type string and `$templateCache` has the matching entry.
1416
*
1517
* @param {string|TrustedResourceUrl} tpl The HTTP request template URL
1618
* @param {boolean=} ignoreRequestError Whether or not to ignore the exception when the request fails or the template is empty

0 commit comments

Comments
 (0)