Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
docs(*): fix docs on recently deprecated properties/methods
Browse files Browse the repository at this point in the history
In commits 9679e58..3dd42ce, some properties
and methods names including the terms whitelist/blacklist were
deprecated in favor of new ones not including the terms.

This commit fixes some typos in docs related to these changes and adds
links to the new properties/methods in the changelog for easier access.

Fixes #17088
  • Loading branch information
gkalpak committed Oct 14, 2020
1 parent 8aa3389 commit 71d19f1
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
21 changes: 13 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,24 @@
## Refactorings

- **SanitizeUriProvider:** remove usages of whitelist
([76738102](https:github.com/angular/angular.js/commit/767381020d88bda2855ac87ca6f00748907e14ff))
([76738102](https://github.com/angular/angular.js/commit/767381020d88bda2855ac87ca6f00748907e14ff))
- **httpProvider:** remove usages of whitelist and blacklist
([c953af6b](https:github.com/angular/angular.js/commit/c953af6b8cfeefe4acc0ca358550eed5da8cfe00))
([c953af6b](https://github.com/angular/angular.js/commit/c953af6b8cfeefe4acc0ca358550eed5da8cfe00))
- **sceDelegateProvider:** remove usages of whitelist and blacklist
([a206e267](https:github.com/angular/angular.js/commit/a206e2675c351c3cdcde3402978126774c1c5df9))
([a206e267](https://github.com/angular/angular.js/commit/a206e2675c351c3cdcde3402978126774c1c5df9))

## Deprecation Notices

- Deprecated ~~`aHrefSanitizationWhitelist`~~. It is now `aHrefSanitizationTrustedUri`
- Deprecated ~~`imgSrcSanitizationWhitelist`~~. It is now `imgSrcSanitizationTrustedUri`
- Deprecated ~~`xsrfWhitelistedOrigins`~~. It is now `xsrfTrustedOrigins`
- Deprecated ~~`resourceUrlWhitelist`~~. It is now `trustedResourceUrlList`
- Deprecated ~~`resourceUrlBlacklist`~~. It is now `bannedResourceUrlList`
- Deprecated ~~`$compileProvider.aHrefSanitizationWhitelist`~~.
It is now [aHrefSanitizationTrustedUrlList](https://docs.angularjs.org/api/ng/provider/$compileProvider#aHrefSanitizationTrustedUrlList)`.
- Deprecated ~~`$compileProvider.imgSrcSanitizationWhitelist`~~.
It is now [imgSrcSanitizationTrustedUrlList](https://docs.angularjs.org/api/ng/provider/$compileProvider#imgSrcSanitizationTrustedUrlList).
- Deprecated ~~`$httpProvider.xsrfWhitelistedOrigins`~~.
It is now [xsrfTrustedOrigins](https://docs.angularjs.org/api/ng/provider/$httpProvider#xsrfTrustedOrigins).
- Deprecated ~~`$sceDelegateProvider.resourceUrlWhitelist`~~.
It is now [trustedResourceUrlList](https://docs.angularjs.org/api/ng/provider/$sceDelegateProvider#trustedResourceUrlList).
- Deprecated ~~`$sceDelegateProvider.resourceUrlBlacklist`~~.
It is now [bannedResourceUrlList](https://docs.angularjs.org/api/ng/provider/$sceDelegateProvider#bannedResourceUrlList).

For the purposes of backward compatibility, the previous symbols are aliased to their new symbol.

Expand Down
2 changes: 1 addition & 1 deletion docs/content/guide/migration.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -2663,7 +2663,7 @@ $scope.findTemplate = function(templateName) {
return templateCache[templateName];
};

// Alternatively, use `$sceDelegateProvider..resourceUrlWhitelist()` (called
// Alternatively, use `$sceDelegateProvider.resourceUrlWhitelist()` (called
// `trustedResourceUrlList()` from 1.8.1 onwards), which means you don't
// have to use `$sce.trustAsResourceUrl()` at all:

Expand Down
12 changes: 6 additions & 6 deletions src/ng/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1734,15 +1734,15 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
* @deprecated
* sinceVersion="1.8.1"
*
* This function is deprecated. Use {@link $compileProvider#aHrefSanitizationTrustedUrlList
* This method is deprecated. Use {@link $compileProvider#aHrefSanitizationTrustedUrlList
* aHrefSanitizationTrustedUrlList} instead.
*/
Object.defineProperty(this, 'aHrefSanitizationWhitelist', {
get: function() {
return this.aHrefSanitizationTrustedUrlList;
},
set: function(regexp) {
this.aHrefSanitizationTrustedUrlList = regexp;
set: function(value) {
this.aHrefSanitizationTrustedUrlList = value;
}
});

Expand Down Expand Up @@ -1785,15 +1785,15 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
* @deprecated
* sinceVersion="1.8.1"
*
* This function is deprecated. Use {@link $compileProvider#imgSrcSanitizationTrustedUrlList
* This method is deprecated. Use {@link $compileProvider#imgSrcSanitizationTrustedUrlList
* imgSrcSanitizationTrustedUrlList} instead.
*/
Object.defineProperty(this, 'imgSrcSanitizationWhitelist', {
get: function() {
return this.imgSrcSanitizationTrustedUrlList;
},
set: function(regexp) {
this.imgSrcSanitizationTrustedUrlList = regexp;
set: function(value) {
this.imgSrcSanitizationTrustedUrlList = value;
}
});

Expand Down
2 changes: 1 addition & 1 deletion src/ng/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ function $HttpProvider() {
* @deprecated
* sinceVersion="1.8.1"
*
* This function is deprecated. Use {@link $httpProvider#xsrfTrustedOrigins xsrfTrustedOrigins}
* This property is deprecated. Use {@link $httpProvider#xsrfTrustedOrigins xsrfTrustedOrigins}
* instead.
*/
Object.defineProperty(this, 'xsrfWhitelistedOrigins', {
Expand Down
3 changes: 1 addition & 2 deletions src/ng/sce.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ function $SceDelegateProvider() {
* The **default value** when no trusted resource URL list has been explicitly set is the empty
* array (i.e. there is no `bannedResourceUrlList`.)
*/

this.bannedResourceUrlList = function(value) {
if (arguments.length) {
bannedResourceUrlList = adjustMatchers(value);
Expand All @@ -258,7 +257,7 @@ function $SceDelegateProvider() {
* @deprecated
* sinceVersion="1.8.1"
*
* This function is deprecated. Use {@link $sceDelegateProvider#bannedResourceUrlList
* This method is deprecated. Use {@link $sceDelegateProvider#bannedResourceUrlList
* bannedResourceUrlList} instead.
*/
Object.defineProperty(this, 'resourceUrlBlacklist', {
Expand Down

0 comments on commit 71d19f1

Please sign in to comment.