1
1
/**
2
- * @license AngularJS v1.3.16
2
+ * @license AngularJS v1.3.17
3
3
* (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
* License: MIT
5
5
*/
@@ -54,7 +54,7 @@ function minErr(module, ErrorConstructor) {
54
54
return match;
55
55
});
56
56
57
- message = message + '\nhttp://errors.angularjs.org/1.3.16 /' +
57
+ message = message + '\nhttp://errors.angularjs.org/1.3.17 /' +
58
58
(module ? module + '/' : '') + code;
59
59
for (i = 2; i < arguments.length; i++) {
60
60
message = message + (i == 2 ? '?' : '&') + 'p' + (i - 2) + '=' +
@@ -2139,11 +2139,11 @@ function toDebugString(obj) {
2139
2139
* - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
2140
2140
*/
2141
2141
var version = {
2142
- full: '1.3.16 ', // all of these placeholder strings will be replaced by grunt's
2142
+ full: '1.3.17 ', // all of these placeholder strings will be replaced by grunt's
2143
2143
major: 1, // package task
2144
2144
minor: 3,
2145
- dot: 16 ,
2146
- codeName: 'cookie-oatmealification '
2145
+ dot: 17 ,
2146
+ codeName: 'tsktskskly-euouae '
2147
2147
};
2148
2148
2149
2149
@@ -4954,7 +4954,7 @@ function Browser(window, document, $log, $sniffer) {
4954
4954
4955
4955
function getHash(url) {
4956
4956
var index = url.indexOf('#');
4957
- return index === -1 ? '' : url.substr(index + 1 );
4957
+ return index === -1 ? '' : url.substr(index);
4958
4958
}
4959
4959
4960
4960
/**
@@ -5081,7 +5081,7 @@ function Browser(window, document, $log, $sniffer) {
5081
5081
// Do the assignment again so that those two variables are referentially identical.
5082
5082
lastHistoryState = cachedState;
5083
5083
} else {
5084
- if (!sameBase) {
5084
+ if (!sameBase || reloadLocation ) {
5085
5085
reloadLocation = url;
5086
5086
}
5087
5087
if (replace) {
@@ -7954,7 +7954,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
7954
7954
7955
7955
$compileNode.empty();
7956
7956
7957
- $templateRequest($sce.getTrustedResourceUrl( templateUrl) )
7957
+ $templateRequest(templateUrl)
7958
7958
.then(function(content) {
7959
7959
var compileNode, tempTemplateAttrs, $template, childBoundTranscludeFn;
7960
7960
@@ -10760,7 +10760,7 @@ function LocationHashbangUrl(appBase, hashPrefix) {
10760
10760
var withoutBaseUrl = beginsWith(appBase, url) || beginsWith(appBaseNoFile, url);
10761
10761
var withoutHashUrl;
10762
10762
10763
- if (withoutBaseUrl.charAt(0) === '#') {
10763
+ if (!isUndefined(withoutBaseUrl) && withoutBaseUrl.charAt(0) === '#') {
10764
10764
10765
10765
// The rest of the url starts with a hash so we have
10766
10766
// got either a hashbang path or a plain hash fragment
@@ -10774,7 +10774,15 @@ function LocationHashbangUrl(appBase, hashPrefix) {
10774
10774
// There was no hashbang path nor hash fragment:
10775
10775
// If we are in HTML5 mode we use what is left as the path;
10776
10776
// Otherwise we ignore what is left
10777
- withoutHashUrl = this.$$html5 ? withoutBaseUrl : '';
10777
+ if (this.$$html5) {
10778
+ withoutHashUrl = withoutBaseUrl;
10779
+ } else {
10780
+ withoutHashUrl = '';
10781
+ if (isUndefined(withoutBaseUrl)) {
10782
+ appBase = url;
10783
+ this.replace();
10784
+ }
10785
+ }
10778
10786
}
10779
10787
10780
10788
parseAppUrl(withoutHashUrl, this);
@@ -16169,23 +16177,34 @@ var $compileMinErr = minErr('$compile');
16169
16177
* @name $templateRequest
16170
16178
*
16171
16179
* @description
16172
- * The `$templateRequest` service downloads the provided template using `$http` and, upon success,
16173
- * stores the contents inside of `$templateCache`. If the HTTP request fails or the response data
16174
- * of the HTTP request is empty, a `$compile` error will be thrown (the exception can be thwarted
16175
- * by setting the 2nd parameter of the function to true).
16176
- *
16177
- * @param {string} tpl The HTTP request template URL
16180
+ * The `$templateRequest` service runs security checks then downloads the provided template using
16181
+ * `$http` and, upon success, stores the contents inside of `$templateCache`. If the HTTP request
16182
+ * fails or the response data of the HTTP request is empty, a `$compile` error will be thrown (the
16183
+ * exception can be thwarted by setting the 2nd parameter of the function to true). Note that the
16184
+ * contents of `$templateCache` are trusted, so the call to `$sce.getTrustedUrl(tpl)` is omitted
16185
+ * when `tpl` is of type string and `$templateCache` has the matching entry.
16186
+ *
16187
+ * @param {string|TrustedResourceUrl} tpl The HTTP request template URL
16178
16188
* @param {boolean=} ignoreRequestError Whether or not to ignore the exception when the request fails or the template is empty
16179
16189
*
16180
16190
* @return {Promise} the HTTP Promise for the given.
16181
16191
*
16182
16192
* @property {number} totalPendingRequests total amount of pending template requests being downloaded.
16183
16193
*/
16184
16194
function $TemplateRequestProvider() {
16185
- this.$get = ['$templateCache', '$http', '$q', function($templateCache, $http, $q) {
16195
+ this.$get = ['$templateCache', '$http', '$q', '$sce', function($templateCache, $http, $q, $sce ) {
16186
16196
function handleRequestFn(tpl, ignoreRequestError) {
16187
16197
handleRequestFn.totalPendingRequests++;
16188
16198
16199
+ // We consider the template cache holds only trusted templates, so
16200
+ // there's no need to go through whitelisting again for keys that already
16201
+ // are included in there. This also makes Angular accept any script
16202
+ // directive, no matter its name. However, we still need to unwrap trusted
16203
+ // types.
16204
+ if (!isString(tpl) || !$templateCache.get(tpl)) {
16205
+ tpl = $sce.getTrustedResourceUrl(tpl);
16206
+ }
16207
+
16189
16208
var transformResponse = $http.defaults && $http.defaults.transformResponse;
16190
16209
16191
16210
if (isArray(transformResponse)) {
@@ -22395,8 +22414,8 @@ var ngIfDirective = ['$animate', function($animate) {
22395
22414
* @param {Object} angularEvent Synthetic event object.
22396
22415
* @param {String} src URL of content to load.
22397
22416
*/
22398
- var ngIncludeDirective = ['$templateRequest', '$anchorScroll', '$animate', '$sce',
22399
- function($templateRequest, $anchorScroll, $animate, $sce ) {
22417
+ var ngIncludeDirective = ['$templateRequest', '$anchorScroll', '$animate',
22418
+ function($templateRequest, $anchorScroll, $animate) {
22400
22419
return {
22401
22420
restrict: 'ECA',
22402
22421
priority: 400,
@@ -22432,7 +22451,7 @@ var ngIncludeDirective = ['$templateRequest', '$anchorScroll', '$animate', '$sce
22432
22451
}
22433
22452
};
22434
22453
22435
- scope.$watch($sce.parseAsResourceUrl( srcExp) , function ngIncludeWatchAction(src) {
22454
+ scope.$watch(srcExp, function ngIncludeWatchAction(src) {
22436
22455
var afterAnimation = function() {
22437
22456
if (isDefined(autoScrollExp) && (!autoScrollExp || scope.$eval(autoScrollExp))) {
22438
22457
$anchorScroll();
0 commit comments