overleaf/services/web/frontend/js/features/binary-file/controllers/binary-file-controller.js
Eric Mc Sween 1186c3e9a4 Merge pull request #3526 from overleaf/cmg-binary-file
[BinaryFile] Binary file React migration

GitOrigin-RevId: e229ad8ec3781607b5ca28387927b84d4af95060
2021-04-24 02:10:07 +00:00

21 lines
558 B
JavaScript

import App from '../../../base'
import { react2angular } from 'react2angular'
import BinaryFile from '../components/binary-file'
import _ from 'lodash'
export default App.controller(
'ReactBinaryFileController',
function ($scope, $rootScope) {
$scope.file = $scope.openFile
$scope.storeReferencesKeys = newKeys => {
const oldKeys = $rootScope._references.keys
return ($rootScope._references.keys = _.union(oldKeys, newKeys))
}
}
)
App.component(
'binaryFile',
react2angular(BinaryFile, ['storeReferencesKeys', 'file'])
)