Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 1.06 KB

File metadata and controls

44 lines (33 loc) · 1.06 KB

Angular

npm install --save img-comparison-slider

CUSTOM_ELEMENTS_SCHEMA should be added into the AppModule and in every other modules that uses img-comparison-slider:

import { BrowserModule } from '@angular/platform-browser';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';

import { AppComponent } from './app.component';

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule, FormsModule],
  bootstrap: [AppComponent],
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}

Import img-comparison-slider into main.ts:

import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';

import 'img-comparison-slider';

if (environment.production) {
  enableProdMode();
}

platformBrowserDynamic()
  .bootstrapModule(AppModule)
  .catch((err) => console.log(err));