2021-04-28 07:41:20 -04:00
|
|
|
import App from '../../../base'
|
|
|
|
import { react2angular } from 'react2angular'
|
|
|
|
import _ from 'lodash'
|
|
|
|
|
2021-05-21 07:32:51 -04:00
|
|
|
import { rootContext } from '../../../shared/context/root-context'
|
2021-06-10 07:26:04 -04:00
|
|
|
import FileView from '../components/file-view'
|
2021-05-21 07:32:42 -04:00
|
|
|
|
2021-04-28 07:41:20 -04:00
|
|
|
export default App.controller(
|
2021-06-10 07:26:04 -04:00
|
|
|
'FileViewController',
|
2021-04-28 07:41:20 -04:00
|
|
|
function ($scope, $rootScope) {
|
|
|
|
$scope.file = $scope.openFile
|
|
|
|
|
|
|
|
$scope.storeReferencesKeys = newKeys => {
|
|
|
|
const oldKeys = $rootScope._references.keys
|
|
|
|
return ($rootScope._references.keys = _.union(oldKeys, newKeys))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
App.component(
|
2021-06-10 07:26:04 -04:00
|
|
|
'fileView',
|
|
|
|
react2angular(rootContext.use(FileView), ['storeReferencesKeys', 'file'])
|
2021-04-28 07:41:20 -04:00
|
|
|
)
|