I am having trouble getting the bs-stepper to function properly within my Angular project

I am currently facing issues with the bs-stepper module in my Angular code. It is not functioning as expected and is throwing errors. Here is a snippet of my code:

export class FileUploadProcessComponent implements OnInit {
     import Stepper from 'bs-stepper';

// @ViewChild("stepperProcess") stepperProcess : Element | null
     NgOnInit(): void {
         document.addEventListener('DOMContentLoaded', function () {
              var stepper = new Stepper(<Element>  document.querySelector('.bs-stepper'))
         })
    }
}

This is the HTML code:

<div id="stepper1" class="bs-stepper" #stepperProcess>
                <div class="bs-stepper-header">
                  <div class="step" data-target="#test-l-1">
                    <button class="step-trigger">
                      <span class="bs-stepper-circle">1</span>
                      <span class="bs-stepper-label">Email</span>
                    </button>
                  </div>
                  <div class="line"></div>
                  <div class="step" data-target="#test-l-2">
                    <button class="step-trigger">
                      <span class="bs-stepper-circle">2</span>
                      <span class="bs-stepper-label">Password</span>
                    </button>
                  </div>
                  <div class="line"></div>
                  <div class="step" data-target="#test-l-3">
                    <button class="step-trigger">
                      <span class="bs-stepper-circle">3</span>
                      <span class="bs-stepper-label">Validate</span>
                    </button>
                  </div>
                </div>
                <div class="bs-stepper-content">
                  <form (ngSubmit)="onSubmit()">
                    <div id="test-l-1" class="content">
                      <div class="form-group">
                        <label for="exampleInputEmail1">Email address</label>
                        <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Enter email" />
                      </div>
                      <button (click)="next()" class="btn btn-primary">Next</button>
                    </div>
                    <div id="test-l-2" class="content">
                      <div class="form-group">
                        <label for="exampleInputPassword1">Password</label>
                        <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password" />
                      </div>
                      <button (click)="next()" class="btn btn-primary">Next</button>
                    </div>
                    <div id="test-l-3" class="content text-center">
                      <button type="submit" class="btn btn-primary mt-5">Submit</button>
                    </div>
                  </form>
                </div>
              </div>

Additionally, here are the errors I am encountering:

ERROR NullInjectorError: R3InjectorError(AppModule)[Stepper -> Stepper -> Stepper]: NullInjectorError: No provider for Stepper! at NullInjector.get (core.mjs:6364:27) at R3Injector.get (core.mjs:6791:33) at R3Injector.get (core.mjs:6791:33) at R3Injector.get (core.mjs:6791:33) at ChainedInjector.get (core.mjs:13868:36) at lookupTokenUsingModuleInjector (core.mjs:3286:39) at getOrCreateInjectable (core.mjs:3331:12) at Module.ɵɵdirectiveInject (core.mjs:10881:12) at NodeInjectorFactory.FileUploadProcessComponent_Factory [as factory] (file-upload-process.component.ts:17:40) at getNodeInjectable (core.mjs:3516:44)

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Angular displays [object Object] upon return

I have been struggling to send a post request, but unfortunately the API is returning undefined. When I try to send it to my API, it shows up as [object Object] getAccouting():Observable<any>{ // let json = this.http.get<any>('/assets/ ...

Upgrading to Angular 14 has caused issues with component testing that involves injecting MAT_DIALOG_DATA

After upgrading Angular from 14.1.1 to 14.2.10 and Material from 14.1.1 to 14.2.7, a peculiar issue arose when running tests with the default Karma runner. I am at a loss as to what could have caused this problem, so any advice would be appreciated. The u ...

A guide on implementing typescript modules within a Node.js environment

It may sound trivial, but unfortunately I am struggling to utilize a Typescript module called device-detector-js in my Node.js project. I have searched the web for solutions on "How to use typescript modules in Node.js", but all I find is tutorials on "Bu ...

Where should the transformation of server response data into a format that the component can interpret be done within the NgRx framework?

New to NgRx and feeling a bit confused at the moment. I have a basic component that displays a list of objects, in this case Orders, retrieved from the backend using an Effect. The challenge is to transform the response from the backend into a simplified l ...

The e2e Protractor test is unable to identify the Angular component within a complex Angular router with multiple layers

I am currently working on an Angular application and I need to set up end-to-end testing for this project. Angular Package: 4.6.6 Protractor: 5.3.0 In addition, my project includes a multi-layer router that wraps the router-outlet into another component ...

Dealing with Endless Loops in React TypeScript: What Happens When State is Set in Multiple Instances of the Same

I'm currently facing an issue where I have two instances of the same component being rendered: <div><Modal title='Login'/></div> <div><Modal title='Join'/></div> Within the component, based on ...

Exploring within the Angular submodule path

I am facing a challenge with nested modules having different URL prefixes. I want to navigate within one module without specifying the prefix, making it accessible regardless of the prefix. Here are the routes for my app.module: const APP_ROUTES: Routes ...

Exploring the capabilities of extending angular components through multiple inheritance

Two base classes are defined as follows: export class EmployeeSearch(){ constructor( public employeeService: EmployeeService, public mobileFormatPipe: MobileFormatPipe ) searchEmployeeById(); searchEmployeeByName(); } ...

Having trouble with npm install on an Angular project? It seems to be failing with an ECONNREFUSED error while trying to

I am facing an issue while trying to clone one of my Angular projects. To make it work, I need to run npm install, which used to work fine in the past. However, recently I encountered the following error: npm install npm ERR! code ECONNREFUSED npm ERR! ...

Error: inability to execute performanceMeasurement.startMeasurement due to its absence in the function definition

An error occurred when attempting to login using @azure/msal-react in Next 13. Upon checking the error log, it was found that the error originated from the core library @azure/msal-react. Even after trying with a login popup, the error persisted. In my co ...

The NgRx Store encountered an error: Unable to freeze

I am currently developing a basic login application using Angular, NgRx Store, and Firebase. I have implemented a login action that is supposed to log in to Firebase and store the credentials in the store. However, it seems like there is an issue in my imp ...

Reconfigure an ancestral item into a designated key

I have a single object with an array of roles inside, and I need to transform the roles into an array of objects. See example below: Current Object: displayConfiguration: { widgetList: { widgetName: 'widget title', entityType: 'As ...

What is the best way to convert a JSON string received from Angular into a Java Object within a Spring

I am currently utilizing WebSocket to create a chat application. Below is the code from my Angular application that sends a MessageModel object to the backend after converting it into a JSON string: sendMessage(message: MessageModel){ let data = JSON.str ...

Gathering adorned categorizations (sans any listed category divisions)

My current setup involves an event dispatcher class that triggers listeners on specified occurrences. I've successfully implemented registering event listeners via decorators, but I feel like there may be a better solution out there. At the moment, e ...

Attempting to invoke a TypeScript firebase function

I'm currently working on incorporating Firebase functions in my index.ts file: import * as functions from "firebase-functions"; export const helloWorld = functions.https.onRequest((request, response) => { functions.logger.info(" ...

How come the variable `T` has been assigned two distinct types?

Consider the following code snippet: function test<T extends unknown[]>(source: [...T], b: T) { return b; } const arg = [1, 'hello', { a: 1 }] const res = test(arg, []) const res1 = test([1, 'hello', { a: 1 }], []) The variabl ...

Unable to execute karma test cases as a result of ngOnDestroy being inaccessible

I have a component structured as follows: export class InkbarComponent implements AfterViewInit, OnDestroy { resizeListener: any; constructor(private _renderer: Renderer, private _elementRef: ElementRef, public renderer: Renderer) { } ngAfter ...

Pictures are shown using the "text/html" layout

I'm having trouble identifying the error and have decided to carefully examine both the client and server code. It seems likely that there is a bug somewhere in Rails. The issue revolves around the photos being displayed in text/html format. Here&apos ...

Using global variables in local Angular-cli components by importing them

Here is an example of my folder structure in Angular CLI: MyApp/ src style/ page/ normalize.less styles.less In my angular-cli.json file, I have the following configuration: "app":{ "styles": [ "./style ...

Issue with SignalR client functionality following update to .NET Core 3.1版本

Upon updating our server-side code to asp.net core 3.1, we encountered an issue with the javascript client for signalr (@microsoft/signalr 3.1.0). The errors we are facing are: https://i.sstatic.net/ITZyK.png Here is the code snippet for the hub initial ...