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

Commit e812b9f

Browse files
snood1205Narretz
authored andcommitted
docs(filter/uppercase): add an example
I saw that the uppercase filter had no example so I decided to add a minimal example to explain how the uppercase filter works. Thank you very much to @Narretz for helping me through this process. Closes #15885
1 parent 6ee7c29 commit e812b9f

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/ng/filter/filters.js

+20-1
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,9 @@ function jsonFilter() {
698698
* @kind function
699699
* @description
700700
* Converts string to lowercase.
701+
*
702+
* See the {@link ng.uppercase uppercase filter documentation} for a functionally identical example.
703+
*
701704
* @see angular.lowercase
702705
*/
703706
var lowercaseFilter = valueFn(lowercase);
@@ -709,6 +712,22 @@ var lowercaseFilter = valueFn(lowercase);
709712
* @kind function
710713
* @description
711714
* Converts string to uppercase.
712-
* @see angular.uppercase
715+
* @example
716+
<example module="uppercaseFilterExample" name="filter-uppercase">
717+
<file name="index.html">
718+
<script>
719+
angular.module('uppercaseFilterExample', [])
720+
.controller('ExampleController', ['$scope', function($scope) {
721+
$scope.title = 'This is a title';
722+
}]);
723+
</script>
724+
<div ng-controller="ExampleController">
725+
<!-- This title should be formatted normally -->
726+
<h1>{{title}}</h1>
727+
<!-- This title should be capitalized -->
728+
<h1>{{title | uppercase}}</h1>
729+
</div>
730+
</file>
731+
</example>
713732
*/
714733
var uppercaseFilter = valueFn(uppercase);

0 commit comments

Comments
 (0)