file-view-controller.js 657 B

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