Reputation: 426
I have an input field which looks like
<input class="inputMargin urlInputWidth" type="text" size="40" name="url" ng-model="user.customerId" maxlength="250" ng-pattern="/sftp://.+/" />
It works fine and shows validation as expected. I just wanted to move this pattern to scope of angularjs to get a much neater form. I have tried with this syntax: $scope.sftpValidate="/sftp://.+/";
and ng-pattern="sftpValidate"
. But this is not validating the pattern at all. i have tried to give as $scope.sftpValidate=/sftp://.+/;
and $scope.sftpValidate=sftp://.+;
. But these are showing syntax errors. Where am i missing?
Upvotes: 2
Views: 1470