Я пытаюсь инициализировать angular-file-uploader из репозитория npm в моем угловом проекте.Интересно, как загрузить файлы на мой локальный хост?Я пытался с префиксом https: просто // префикс, ./, ./assets, ничего не работает.
"dependencies": {
"@angular/animations": "^7.2.5",
"@angular/common": "^7.2.5",
"@angular/compiler": "^7.2.5",
"@angular/core": "^7.2.5",
"@angular/forms": "^7.2.5",
"@angular/platform-browser": "^7.2.5",
"@angular/platform-browser-dynamic": "^7.2.5",
"@angular/router": "^7.2.5",
"angular-file-uploader": "^5.0.2",
"core-js": "^2.6.5",
"rxjs": "~6.3.3",
"tslib": "^1.9.0",
"zone.js": "~0.8.26"
},
app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
afuConfig = {
uploadAPI: {
url: 'https://localhost:4200/assets/'
}
};
}
app.component.html
<angular-file-uploader [config]=afuConfig>
</angular-file-uploader>
Я получаю следующую ошибку.
иногда я также получаю эту ошибку
Проект существует здесь, если вы хотитетянуть: https://github.com/kzrfaisal/angular-file-uploader