Code Monkey home page Code Monkey logo

Comments (9)

AlanCrevon avatar AlanCrevon commented on August 10, 2024 1

Same problem here.
@chakermellek : i can't make your workaround work. Could you give more infos ?

from ng2-image-upload.

briangardner avatar briangardner commented on August 10, 2024

I'm having the same issue.

from ng2-image-upload.

pisix avatar pisix commented on August 10, 2024

I'm having the same issue

from ng2-image-upload.

lutsifer avatar lutsifer commented on August 10, 2024

Same, anyone solution?

from ng2-image-upload.

kevincaicedo avatar kevincaicedo commented on August 10, 2024

I am also having the same problem some solution ?

from ng2-image-upload.

salttechno avatar salttechno commented on August 10, 2024

Has anyone got the solution for this?

from ng2-image-upload.

lutsifer avatar lutsifer commented on August 10, 2024

besides switching package - no. But in general there is no good file upload for angular 2. There is always something that is not exactly as it has to be...

from ng2-image-upload.

chakermellek avatar chakermellek commented on August 10, 2024

As a workaround solution, you can set the provider yourself in the root module.

 import {BrowserModule} from '@angular/platform-browser';
   import {NgModule} from '@angular/core';
  import {AppComponent} from './app.component';
  import {AppRoutingModule} from "./app-routing.module";
  import {ImageUploadModule} from "angular2-image-upload";
  import {ImageService} from "angular2-image-upload/lib/image.service";


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

    AppRoutingModule,
    PagesModule
  ],
  providers: [
    {provide: ImageService, useClass: ImageService}
  ],
  bootstrap: [AppComponent]
})
export class AppModule {
}

Then in the module where you want to upload images, you have to import the ImageUploadModule.

PS: The ImageUploadModule.forRoot() causes the problem, don't add it to the AppModule until this problem is fixed.

from ng2-image-upload.

pisix avatar pisix commented on August 10, 2024

@chakermellek pls Can you provide a plunker of your workaround ?
Thanks .

from ng2-image-upload.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.