npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

transit-form-registration

v0.1.1

Published

This library provides a customizable registration form for Angular applications.

Downloads

4

Readme

Angular Registration Form Library

This library provides a customizable registration form for Angular applications.

Compatibility

| Angular Version | Compatible? | | --------------- | ----------- | | 14.2.0+ | ✅ | | below 14.2.0 | ❌ |

Installation

You can install the library using npm:

npm i transit-form-registration

Usage

  1. Import the RegistrationFormModule in your application's module:
import { RegistrationFormModule } from "transit-form-registration";

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule, AppRoutingModule, RegistrationFormModule],
  providers: [],
  bootstrap: [AppComponent],
})
export class AppModule {}
  1. Import the library assets into your angular.json:
"assets": [
  "src/favicon.ico",
  "src/assets",
  {
    "glob": "**/*",
    "input": "./node_modules/transit-form-registration/assets",
    "output": "/assets"
  }
]

This step allows you to use the assets included in the library.

  1. Use the lib-registration-form component in your Angular template:
<lib-registration-form backgroundImage="" imageSrc="" apiLink="" selectedLanguage="en" formTitle="Sign Up" submitButton="Sign Up" firstName="true" lastName="true" fullNam="false" userName="true" email="true" gender="true" phoneNumber="true" ssn="true" passportNumber="false" birthday="false" passwordThreshold="8" passphraseThreshold="32" [regExp]="regExp" (onFormSubmit)="handleRegistration($event)"></lib-registration-form>

The lib-registration-form component takes the following:

  • backgroundImage (string): The URL of the background image for the registration form.
  • imageSrc (string): The URL of the image to display in the registration form.
  • apiLink (string): The API for submitting the registration form.
  • selectedLanguage (string): Set the language; "ar" for Arabic and "en" for English.
  • formTitle (string): Set the form title like "Register" or "Sign Up".
  • submitButton (string): Set the Submit button's content.
  • firstName (boolean): Enable/Disable the First Name field.
  • lastName (boolean): Enable/Disable the Last Name field.
  • userName (boolean): Enable/Disable the User Name field.
  • email (boolean): Enable/Disable the E-mail field.
  • gender (boolean): Enable/Disable the Gender field.
  • ssn (boolean): Enable/Disable the Social Security Number field.
  • passportNumber (boolean): Enable/Disable the Passport Number field.
  • birthday (boolean): Enable/Disable the Birthday field.
  • passwordThreshold (number): The minimum number of characters allowed in the password. Default is 8.
  • passphraseThreshold (number): The maximum number of characters before the password is considered a passphrase (which is more secure). Default is 32.
  • regExp (regular expression): What pattern to check the password against. Supply from a variable for the best results.

The component also has an "onFormSubmit" event whose data can be handled in your project.

Notes:

  • Set the input values based on your specific requirements.
  • The form includes these inputs by default:
    • firstName
    • lastName
    • userName
    • email

You can remove these inputs by setting them to "false" e.g. [userName]="false" and you can add more inputs as you need like [phoneNumber]="true".

  1. Set the function that will handle the onFormSubmit event:
handleRegistration(event: any) {
  // Your code here
}

Do not forget to call the module service's handleRegistration(event) function.