binary-file-controller.js 558 B

123456789101112131415161718192021
  1. import App from '../../../base'
  2. import { react2angular } from 'react2angular'
  3. import BinaryFile from '../components/binary-file'
  4. import _ from 'lodash'
  5. export default App.controller(
  6. 'ReactBinaryFileController',
  7. function ($scope, $rootScope) {
  8. $scope.file = $scope.openFile
  9. $scope.storeReferencesKeys = newKeys => {
  10. const oldKeys = $rootScope._references.keys
  11. return ($rootScope._references.keys = _.union(oldKeys, newKeys))
  12. }
  13. }
  14. )
  15. App.component(
  16. 'binaryFile',
  17. react2angular(BinaryFile, ['storeReferencesKeys', 'file'])
  18. )