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

Check if "input" variable is defined #6819

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/content/guide/filter.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ text upper-case.
angular.module('MyReverseModule', []).
filter('reverse', function() {
return function(input, uppercase) {
// if nothing was entered yet
if(!(input)){
return;
}
var out = "";
for (var i = 0; i < input.length; i++) {
out = input.charAt(i) + out;
Expand Down