qjon / angular2-filemanager

MIT License
15 stars 9 forks source link

main.ts is missing from the TypeScript compilation #15

Closed PaulRDX closed 6 years ago

PaulRDX commented 6 years ago

Hi guys!

So I'm trying to implement your filemanager in a project but I'm not quite sure exactly how to proceed.

I ran npm i @rign/angular2-filemanager

I have a CloudComponent where I want to use <filemanager>Loading...</filemanager>

Here is my actual code:


cloud.component.ts:

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

@Component({
  selector: 'app-cloud',
  templateUrl: './cloud.component.html',
  styleUrls: ['./cloud.component.css']
})
export class CloudComponent implements OnInit {

  constructor() {
   }

  ngOnInit() {
  }

}

cloud.component.html:

<filemanager>Loading...</filemanager>


app.module.ts:

...
import { FileManagerModule } from '@rign/angular2-filemanager/main';
import { CloudComponent } from './cloud/cloud.component';

const fileManagerConfiguration: IFileManagerConfiguration = {
  urls: {
    foldersUrl: '/api/folder',
    filesUrl: '/api/files',
    folderMoveUrl: '/api/folder/move'
  },
  isMultiSelection: true,
  mimeTypes: ['image/jpg', 'image/jpeg', 'image/png'],
  maxFileSize: 50 * 1024
};

@NgModule({
  declarations: [
    ...
  ],
  imports: [
    ...
    FileManagerModule.forRoot(fileManagerConfiguration)
  ],
  providers: [
    ...
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

When I run ng serve, i've got an error: main.ts is missing from the TypeScript compilation

qjon commented 6 years ago

Hi,

Could you give me more info? This main.ts is my file (from filemanager) or from your project?

PaulRDX commented 6 years ago

The one imported by import { FileManagerModule } from '@rign/angular2-filemanager/main'; in app.module.ts

qjon commented 6 years ago

It seems like a configuration problem with new CLI. I'll check it.

qjon commented 6 years ago

Fixed in #18 .