I am actually got a angular form and some input inside. The purpose is to upload files in a cloud. So, I got an input for a directory path which could contain some sub-directories. So I got a regex on my JS in a scope like this: $scope.regex = "^[^\/]\S+$";
this regex would accept any characters if its not a "/" at first character.
and here's my angular code:
<input name="directory" id="directory" type="text" class="form-control" ng-pattern="regex" ng-model="directoryName" placeholder="Enter a directory name"/>
<span class="error" ng-show="uploaderForm.directory.$error.pattern">directory path can't start by a "/"</span>
Normally, with this regex, this path should be success:
directory/subdirectories/filename...
and this one shouldn't:
/directory/subdirectories/filename...
But my problem is that when i'm writing something like : test/subtest/blablabla, I got the ng-show error...
Note that my input can also be a single char, like a
.