vdanyliv / ngx-tiny-slider

Angular wrapper for tiny-slider
https://npmjs.com/package/ngx-tiny-slider
MIT License
15 stars 18 forks source link

Module Class and config Interface are not resolved #6

Closed arizanovj closed 5 years ago

arizanovj commented 5 years ago

I installed this plugin and it's not resolved by the application. Is there something else that needs to be done besides importing the module and setting the config in the component. This is how my setup looks:

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { HomeComponent } from './home.component';
import { HomeRoutingModule } from './home-routing.module';

@NgModule({
  imports: [
    CommonModule,
    HomeRoutingModule,
    NgxTinySliderModule, // module is not shown on autocomplete in VSC
  ],
  declarations: [HomeComponent]
})
export class HomeModule { }

And this is the component:

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

@Component({
  selector: 'app-home',
  templateUrl: './home.component.html',
  styleUrls: ['./home.component.scss']
})
export class HomeComponent implements OnInit {
  tinySliderConfig: NgxTinySliderSettingsInterface;
  constructor() { }

  ngOnInit() {
    this.tinySliderConfig = {
      arrowKeys: true,
      autoWidth: true,
      gutter: 10,
      controlsText: ['<', '>']
    }
  }

}

NgxTinySliderSettingsInterface is not resolved either (not shown on autocomplete). I have other third party components and they resolved just fine in VSC. This is what I get during compilation: Failed to compile.

src/app/home/home.component.ts(9,21): error TS2304: Cannot find name 'NgxTinySliderSettingsInterface'.
src/app/home/home.module.ts(10,5): error TS2304: Cannot find name 'NgxTinySliderModule'.
vdanyliv commented 5 years ago

Hi @arizanovj! Thanks for raising the issue, I will check component today, and let you know how to resolve the problem.

vdanyliv commented 5 years ago

I've installed version 0.0.4 and everything works fine

Screen Shot 2019-04-14 at 8 52 55 PM

Also, don't forget about imports of tiny-slider-interface in your home.component import {NgxTinySliderSettingsInterface} from 'ngx-tiny-slider';

and NgxTinySliderModule in home.module

vdanyliv commented 5 years ago

@arizanovj I've update readme and create a new release, check it, please. In case if you will get this error again, please leave feedback

arizanovj commented 5 years ago

@vdanyliv All is good now. Thanks for your effort.