GithubHelp home page GithubHelp logo

ahmed-elbald / multi-step-form-angular Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.74 MB

๐Ÿ“ This is my solution for Frontend Mentor's Multi-Step Form challenge

Home Page: https://ahmed-elbald.github.io/Multi-Step-Form-Angular/

HTML 22.22% SCSS 33.44% TypeScript 44.34%
angular angular2 bem-methodology css html-accessibility html5 javascript scss typescript forms

multi-step-form-angular's Introduction

Design preview for the Multi-step form coding challenge

Frontend Mentor - Multi-step form



Built With

  • HTML
  • SCSS
  • Typescript
  • Angular v17
  • NgRx Component Store
  • RxJs

App Features

I've implemented all the features required by the original challenge, thus the user can:

  • Complete each step of the sequence
  • Go back to a previous step to update their selections
  • See a summary of their selections on the final steps and confirm their order
  • Receive form validation messages if:
    • A field has been missed
    • The email address is not formatted correctly
  • See hover and focus states for all interactive elements on the page
  • See animation effects when navigating from step to another

In addition, most form sections are built dynamically allowing for other features to be added easily in the future.

Intro

This is one of Frontend Mentor's interesting challenges. It's not the first time I tackle it though. I did it about five month ago. Then, I decided to recreate it after learning Angular. Thus I used HTML, SCSS and Angular. I've also improved the overall accessibility and my code structure.

Hard Decisions I Had To Make

Throughout this project, I came across a couple of problems that required taking some hard decisions. Here are some of them:

  1. Structuring the project folders:

    At first, I was going to use the AppComponent as the main component for the form feature. But then I decided that such a form can not be the main feature of an application. So, I've decided to make a separate feature called purchase, in which I included the whole form. Regarding the structure of each feature's folder, I took that from Joshua Morony's video about structuring Angular projects.

  2. Should I use NgRx Global or Component Store?

    Honestly, I was going to use the Global Store. But again, I imagined what this form would look like inside a large website, and how important it might be. I ended up deciding that its state could be managed using the Component Store. I don't know if my decision was right especially that my store file is quite long. I would appreciate any feedback concerning that matter.

  3. Structuring the form:

    Since the form is multi-step, I had to decide how to split those steps... Should they have different routes or may I just use links that point to page fragments like #personal-info or #summary? I finally opted to use fragments as it seemed to me that transitioning from step to another does not resemble transitioning among routes, which usually involve changing the whole view. I also used a StepComponent that represented the basic structure of all form steps like the header and the content.

What I Learned

In order to create this form, which is quite complex, I learned some Angular techniques I didn't know about like:

  1. Creating custom form controls using the ControlValueAccessor Interface.
  2. Making reusable input components by providing the ControlContainer to the component view.
  3. Some important WAI ARIA attributes for forms like aria-invalid and aria-errormessage.

Contribution

If you want to make any suggestions, feel free to do that in the discussions section. Also, feel free to clone the repo and play around with the source could.

multi-step-form-angular's People

Contributors

ahmed-elbald avatar

Stargazers

 avatar

Watchers

 avatar

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.