angular2-next-wizard

0.0.5 • Public • Published

angular2-next-wizard

This is an Angular2 Form Wizard component. Just like any form wizard. You can define steps and control how each step works. You can enable/disable navigation button based on validity of the current step. Currently, the component only support basic functionality. More features will come later.

You can checkout the demo below and see how to use it in the next section.

Dependencies

  • Angular2 (tested with 2.3.1)
  • Bootstrap 4
  • Inicons 2

Installation

After installing the above dependencies, install angular2-next-wizard via:

$ npm install angular2-next-wizard --save

How to use the component

Once you have installed the library, you can import it in AppModule of your application:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
 
// Import your library
import { FormWizardNextModule } from 'angular2-wizard';
 
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    // Specify the library as an import
    FormWizardNextModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Please add in your angular-cli for enable icons

"styles": [
        // next line
        "../node_modules/ionicons/dist/scss/ionicons.scss"
      ]

Please add in main.ts for enable animations

  import 'web-animations-js/web-animations.min';

And

Once your library is imported, you can use form-wizard and wizard-step components in your Angular application:

<div class="container">
<form-wizard>
  <wizard-step [title]="'1. Escolha o Tipo de Processo'" [dados]="[{name:'Data',value:'Teste'},{name:'Data',value:'Teste'},{name:'Data',value:'Teste'},{name:'Data',value:'Teste'}]">
    <div>
      Example #1
    </div>
  </wizard-step>
  <wizard-step [title]="'Step2'">
    <h1>Example #2</h1>
  </wizard-step>
  <wizard-step [title]="'Step3'">
    <h1>Example #3</h1>
  </wizard-step>
  <wizard-step [title]="'Step4'">
    Example #4
  </wizard-step>
  <wizard-step [title]="'Step4'" (onComplete)="onComplete($event)">
    <div [ngSwitch]="isCompleted">
      <div *ngSwitchDefault>
        <h1>Step4</h1>
      </div>
      <div *ngSwitchCase="true">
        <h4>Thank you! You have completed all the steps.</h4>
      </div>
    </div>
  </wizard-step>
</form-wizard>

Package Sidebar

Install

npm i angular2-next-wizard

Weekly Downloads

5

Version

0.0.5

License

MIT

Last publish

Collaborators

  • mrhanaute
  • douglasdm97