mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
improve
This commit is contained in:
@@ -15,6 +15,8 @@ import { ToastService } from 'src/app/services/toast.service';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { ThemePalette } from '@angular/material/core';
|
||||
import { formatDate } from 'src/plugin/momentG.js'
|
||||
import { FileLoaderService } from 'src/app/services/file/file-loader.service';
|
||||
import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-publication',
|
||||
@@ -66,6 +68,8 @@ export class NewPublicationPage implements OnInit {
|
||||
private publications: PublicationsService,
|
||||
private camera: Camera,
|
||||
private toastService: ToastService,
|
||||
private fileLoaderService: FileLoaderService,
|
||||
private fileToBase64Service: FileToBase64Service
|
||||
) {
|
||||
|
||||
this.publicationType = this.navParams.get('publicationType');
|
||||
@@ -100,6 +104,22 @@ export class NewPublicationPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
laodPicture() {
|
||||
const input = this.fileLoaderService.createInput({
|
||||
accept: ['image/apng', 'image/jpeg', 'image/png']
|
||||
})
|
||||
|
||||
input.onchange = async () => {
|
||||
const file = this.fileLoaderService.getFirstFile(input)
|
||||
|
||||
const imageData = await this.fileToBase64Service.convert(file)
|
||||
this.capturedImage = imageData;
|
||||
this.capturedImageTitle = file.name
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
getPicture() {
|
||||
const options: CameraOptions = {
|
||||
quality: 90,
|
||||
|
||||
Reference in New Issue
Block a user