Git Product home page Git Product logo

angular-parsers-formatters-validators-lab's Introduction

Parsing and displaying form data and errors

Objectives

  • Use $parsers, $formatters and $validators to format form Models
  • Use ngMessages to display relevant error messages

Instructions

In this repo we've got a sign up form. This requires the user's name, and their coupon code.

  1. Add a directive that uses $parsers and $formatters to ensure that the coupon is always displayed in lowercase in the view, no matter what case we type in.

  2. We also need to make sure the coupon code is correct. This should conform to the regular expression /\d{2}[a-z]{4}\d{2}/i (two digits, then 4 characters, then 2 digits). Add a directive to validate this! If there's an error with the code, it should be displayed on the view!

angular-parsers-formatters-validators-lab's People

Contributors

gj avatar ipc103 avatar toddmotto avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-parsers-formatters-validators-lab's Issues

Inconsitency

I think there's an inconsistency in this lab regarding whether a $formatter is required... because I don't believe it is as the specs are written even though the directions mention's including one. The solution includes a $formatter, but to make the coupon code upper case which seems unrelated to the lab's instructions. I think the directions/solution/specs could just be tweaked slightly for consistency.

$formatters not necessary

Not sure if this was intended, but only $parsers is required to pass this lab. I commented out my $formatters and everything works fine. $parsers is doing the job of the formatters since the input is being displayed immediately after being parsed. It would be pretty simple to add an element that uses $formatters for some model that isn't already being parsed for the exact same thing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.