MeetmeLeave / ng-canvas-gauges

Angular2 component wrapper for the canvas-gauges library written by @Mikhus(https://github.com/Mikhus/canvas-gauges).
MIT License
38 stars 23 forks source link

Module build failed #6

Closed cocaybica closed 7 years ago

cocaybica commented 7 years ago

Hi,

I'm trying this on Ionic 3.6.0. I followed the install instructions. Then added imports to app.module.ts and home.ts:

app.module.ts:

import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';

import { GaugesModule} from 'ng-canvas-gauges/src';

import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';

@NgModule({
  declarations: [
    MyApp,
    HomePage
  ],
  imports: [
    BrowserModule,
    GaugesModule,
    IonicModule.forRoot(MyApp)
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    HomePage
  ],
  providers: [
    StatusBar,
    SplashScreen,
    {provide: ErrorHandler, useClass: IonicErrorHandler}
  ]
})
export class AppModule {}

home.ts:

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
//import { GaugeModule } from 'ng2-gauge';
//import { ngRadialGauge } from 'bower_components/ngRadialGauge/src'
//import { GaugeModule } from 'ng-gauge';

import { GaugesModule} from 'ng-canvas-gauges/src';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  constructor(public navCtrl: NavController) {

  }
}

But the app gives me the follow error when it is loaded to the browser (ionic serve):

Module build failed: Error: ENOENT: no such file or directory, open '//////////node_modules/ng-canvas-gauges/src/index.js'

(I eliminated the redundant directories)

Whats wrong?

rgbsuede commented 7 years ago

Hi @cocaybica! I have encountered and fixed this issue in #8

Basically, change ng-canvas-gauges/src to ng-canvas-gauges/lib

cocaybica commented 7 years ago

Hi,

I had solved by copying the required files from lib to src directory.

Thank you