The 'angular-image-slider' component is unable to bind to 'images' because it does not recognize it as a valid property, even after installation

I recently added a new package to my project using 'npm install angular-image-slider --save' and included sliderModule in the app.module.ts file

    import { AppComponent } from './app.component';
    import { AppRoutingModule } from './/app-routing.module';
    import { SliderModule } from 'angular-image-slider';
    import { HomeComponent } from './home/home.component';

    @NgModule({
      declarations: [
        AppComponent,
      ],
    imports: [

      DragScrollModule,
      SliderModule,
      HttpModule,
      FormsModule,
      ReactiveFormsModule,
      AppRoutingModule,
      FileUploadModule,
      TagInputModule,
      BrowserAnimationsModule,
      NgxCurrencyModule,
      NgbModule.forRoot(),
      ScrollToModule.forRoot(),
      MetaModule.forRoot(),
      BrowserModule.withServerTransition({appId: 'my-app'}),
      DataTablesModule
  ],  
providers: [TravalservicesService, Globalvar, Alwaysguard, Alwaysguradhost, Alwaysguarduserhost, LoaderService, {provide: NgbDateParserFormatter, useClass: NgbDateFRParserFormatter}],
  bootstrap: [AppComponent]
})
export class AppModule { }

home.component.html

 <div class="row">
    <h2 class="text-uppercase fs-20px text-strong">SENSE</h2>
      <angular-image-slider [images]="imagesUrl"></angular-image-slider>    
  </div> 

In the home.component.ts file

import { Component } from '@angular/core';
@Component({
  selector: 'app-home',
  templateUrl: './home.component.html',
  viewProviders: [Title],
  styleUrls: ['./home.component.css'],

})
export class HomeComponent implements OnInit {
public imagesUrl;

ngOnInit() {
    this.imagesUrl = [
    'IMAGE_URL1.jpg',
    'IMAGE_URL2.jpg',
    'IMAGE_URL3.jpg',
    ];
}
}

However, I encountered some errors: Error: Template parse errors: Can't bind to 'images' since it isn't a known property of 'angular-image-slider'. 1. If 'angular-image-slider' is an Angular component and it has 'images' input, then verify that it is part of this module. 2. If 'angular-image-slider' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. 3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.

'angular-image-slider' is not a known element: 1. If 'angular-image-slider' is an Angular component, then verify that it is part of this module. 2. If 'angular-image-slider' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

Apologies for the unusual question as I am still learning about Angular development.

Answer №1

To properly utilize your component, don't forget to include it in the declarations section as shown below:

declarations: [
  AppComponent,
  HomeComponent
],
imports: [
    BrowserModule,
    BrowserAnimationsModule,
    SliderModule
],

If you fail to import the component into the module, the library definition code will not be accessible.

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

What is the best way to showcase nested array information from a JSON file on an HTML webpage?

students.json { "students": [ { "studentname": "Rohit Kumar", "grade": "A", "student": [ { "SNo": "1", "Subject": "Maths", "Concept": "Numbers" }, { "SNo": "2", ...

The Facebook Like Button appears on Firefox but not on Internet Explorer due to Javascript errors

Hello everyone, I could really use some help with an issue I am facing. My Facebook like button works perfectly fine in Firefox, but when it comes to Internet Explorer, I keep encountering Javascript errors and the button doesn't show up at all: If y ...

What is the best way to retrieve id elements from a hidden field in jquery?

I'm working with a form that contains hidden fields and I need to retrieve the id of each hidden field. My goal is to potentially remove hidden elements using their id using jQuery's Remove methods. Form: <form id="postform" method="post" ac ...

What is the process for adjusting the color of the standard Chromium music player?

On my blog, I am looking to modify the color of the default chromium music player that is currently being displayed for my visitors. The existing player can be seen here: https://i.sstatic.net/73ewd.png I would like to change it to a different color so th ...

Angular Error: Unable to access 'State' property as it is undefined

Currently, I am endeavoring to enhance my understanding of routing by implementing it on a specific page within my healthcare application using Angular. However, when attempting to retrieve data, we encountered the following error: users.component.ts:15 ER ...

How can I assign a specific class to certain elements within an *ngFor loop in Angular?

I have a situation where I am utilizing the *ngFor directive to display table data with the help of *ngFor="let record of records". In this scenario, I am looking to assign a custom CSS class to the 'record' based on specific conditions; for exam ...

Developing an ASP.NET message box feature with options for both "OK" and "Cancel

I have implemented a JavaScript function in my website to display a message box to the user: Private Sub MessageBox(ByVal msg As String) Dim lbl As New Label lbl.Text = "<script language='javascript'>" & Environment.NewLine &a ...

When using mongoose.save(), the data is not stored successfully

I spent 5 hours trying to solve this problem but couldn't figure out what's wrong in the file -routes/users.ts, The line ""targetUser.token = token" is working, so console.log(targetUser) shows the updated user data. However, targetU ...

Lack of Synchronization in JavaScript Dates

When receiving a time value from the client in epoch format (milliseconds since Jan 1 1970) on my node server, I convert it using the Date() object and display it as follows: var d = new Date(epochTime); var year = d.getFullYear(); var mo = d.getMonth(); ...

When the mouse is clicked, stop the rotation tween and start the tween effect

I have a rotating object on the z-axis. When the mouse is clicked (onMouseDown), the rotation stops, and when the mouse is released (onMouseUp), the rotation resumes after a 2-second delay. Is there a way to make the rotation resume slowly, like easing in ...

Troubleshooting Variable Issues in PHP and JavaScript

On my PHP page, I have a while loop where I am retrieving the following... print $divLeft.strip_tags($row->twitterUser)."?size=normal\"/><br \/>".$row->twitterUser.$divRight."<a href='javascript:void(0);' id=&apos ...

Creating a Chrome extension that opens multiple tabs using JavaScript

Currently, I am working on a chrome extension that includes several buttons to open different tabs. However, there seems to be an issue where clicking the Seqta button opens the tab three times and clicking the maths book button opens the tab twice. Below, ...

Guide to populating a full calendar using JSON information

Implementing the FUllCALENDAR CSS template for creating a meeting calendar has been my current project. The servlet class I am using is CalendarController. However, when running it, the output appears as follows: {"events":[{"id":1,"title":"1","s ...

how to change class on vue function result

I need a way to display the content stored in requestData as li elements. Each list item should have an onclick function that, when clicked (selected), adds a specific value from a reference to an array. If clicked again (unselected), it should remove the ...

Unable to access a text file while executing a javascript file as a systemd service

Running a javascript file using node on a Raspberry Pi at startup automatically through a systemd service has been giving me some trouble. I followed a guide similar to this one to set it up. When I manually run the javascript file by entering the comman ...

What are some alternative methods for transferring data between Vue sibling components without relying on 'params'?

I currently have 2 main components in my application: Proyectos.vue Reuniones.vue In the Proyectos component, I make a `GET` request which retrieves an array of project objects. This list of projects is then displayed in a table. Structure of Project O ...

Modify the CSS class of a <TD> element depending on the value of the column using JavaScript

I am working on a grid where I need to dynamically change the CSS of one of the columns based on the value from another field in the result set. Instead of simply assigning a class like <td class='class1'> ${firstname} </td> I ...

What would be the JavaScript version of the below jQuery code?

I am interested in creating a spinning wheel where instead of the entire wheel rotating, only the pointer rotates. I currently have a jQuery code snippet that achieves this effect, but I am looking to convert it into JavaScript. Current jQuery code: $( d ...

How can Angular environments file variables be used to set up separate firebase.json files for testing and production in Firebase?

Is there a method to have separate firebase.json files for testing and production, or use configurable variables? I am working on an Angular project and my main objective is to have different firebase.rules files for test and production environments. Spe ...

Issue with MeteorJS: The template event fails to trigger when within a popover

I'm facing an issue with my code. The problem I'm encountering is that the button "viewcart" click event is not triggering when clicked. This button is located inside a popover. Does anyone have any suggestions on how to activate the button click ...