import { IFolderInfo, IFileInFolderInfo } from 'isogd-file-rest'; import { OrderDocumentInstruction } from 'orders-rest'; import * as _ from 'lodash'; class InstructionReadOnlyController { private instruction: OrderDocumentInstruction; private folderInfo: IFolderInfo; private id: string; getFileByIds(ids: string[]): IFileInFolderInfo[] { return _.filter(this.folderInfo.files, f => { return _.findIndex(ids, i => { return i === f.versionSeriesGuid; }) !== -1; }); } } export const InstructionReadOnlyCardComponent: angular.IComponentOptions = { controller: InstructionReadOnlyController, template: require('./instructionReadOnlyCard.html'), bindings: { instruction: '<', folderInfo: '<' } }; export const InstructionReadOnlyTaskComponent: angular.IComponentOptions = { controller: InstructionReadOnlyController, template: require('./instructionReadOnlyTask.html'), bindings: { instruction: '<', folderInfo: '<', id: '<' } };