0

I'm working on an email input form where a user inputs an email address. I need to ensure that the email address is lower-case. What i'm struggling with is that i'm able to take an array or a string and convert it into lowercase or uppercase. However because this is asking for a user to input something i've been having trouble using those same techniques.

  %zip-input-md{ type: "email", "ng-model" => "vm.form.email", required: true, 'ng-maxlength' => 50, 'ng-disabled' => 'vm.form.validated_email' }
    Email address

I was initially thinking that the solution was {{ lowercase_expression | lowercase}} but that only works well for existing strings.

On the back end in the controller, the vm.form.email was defined in a submitForm method.

  vm.submitForm = (isValid) ->
    success = ->
      TokenService.post vm.form.email, vm.form.password
        .then tokenServiceSuccess, tokenServiceError
        .then tokenServiceFinally
      return

If anybody has any good ideas, i'd really appreciate it.

1 Answer 1

1

Inject the service $filter in your controller and then:

 vm.submitForm = (isValid) ->
    success = ->
      TokenService.post $filter('lowercase')(vm.form.email), vm.form.password
        .then tokenServiceSuccess, tokenServiceError
        .then tokenServiceFinally
      return
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.