binary-file-controller.js 643 B

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