This is going to be dumb, but I can't figure this out, nor find the answer
scope.newNote = "";
scope.addNote = function(note) {
console.log(note);
if (!note || note === '' || note.trim().length === 0) {
return;
}
}
HTML
<wysiwyg textarea-class="form-control" textarea-required ng-model="newNote" enable-bootstrap-title="true"></wysiwyg>
<button class="btn btn-default right" ng-click="addNote(newNote); newNote = null;">Add</button>
When I enter a bunch of spaces, this prints "'&''n''b''s''p'';''&''n''b''s''p'';'"
Hence, the note.trim().length is equal to 12
How do I check for strings that are just spaces?
Thanks
?