import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {HomeService} from "../../home/home.service";

@Component({
    selector: 'page-file-list',
    templateUrl: 'file-list.html',
})
export class FileListPage {

    accessoryMaterials;
    obj;

    constructor(public navCtrl: NavController, public navParams: NavParams,
                private homeSer: HomeService) {
        this.accessoryMaterials = this.navParams.get('accessoryMaterials');
        this.obj = this.navParams.get('obj');
    }

    ionViewDidLoad() {
        console.log('ionViewDidLoad FileListPage');
    }

    getFile(item) {
        const data = {
            id: item.accessoryMateriaId,
            flow: this.obj.flow,
            type: this.obj.type,
        }
        this.homeSer.fileAttach(data).subscribe(
            (res) => {

            }
        )
    }

}
