Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

How to use StepperComponent in Angular?


How do I use StepperComponent from _StepperComponent.ts file in Angular project.

I copied this from html documentation and tried to make use of it, but couldn't make it work, couldn't find docs with anything other than html.


<div class="stepper stepper-pills stepper-column d-flex flex-column flex-xl-row flex-row-fluid" id="kt_modal_create_app_stepper">
<div ... ></div>
</div>


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)

Hi Luzan Baral

Sorry for the delay in response. To use the StepperComponent in an Angular project, you can follow these steps:

In your Angular component where you want to use the StepperComponent, import the plugin.

   import { StepperComponent, defaultStepperOptions } from '';

Initialize the StepperComponent in your Angular component. You can use the ngAfterViewInit lifecycle hook to ensure the DOM elements are ready.

   import { AfterViewInit, Component, ElementRef } from '@angular/core';

   @Component({
     selector: 'app-stepper',
     template: `
       
`, }) export class StepperComponent implements AfterViewInit { constructor(private elementRef: ElementRef) {} ngAfterViewInit(): void { const stepperElement = this.elementRef.nativeElement.querySelector('[data-kt-stepper]'); if (stepperElement) { new StepperComponent(stepperElement, defaultStepperOptions); } } }

Use the app-stepper component in your Angular template.

   

Add the necessary HTML structure and content within the app-stepper component's template.

   
Step 1
Content 1
Step 2
Content 2
Step 3
Content 3

Style the stepper component as per your design requirements and enhance its functionality using Angular features as needed.

Adjust the StepperComponent initialization code to fit your Angular project's structure and requirements.

Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(