overleaf/services/web/frontend/js/features/file-view/controllers/file-view-controller.js
Jakob Ackermann e959529828 Merge pull request #15129 from overleaf/mj-jpa-angular-parameters
[web] Explicitly name angular parameters

GitOrigin-RevId: 91beae68989d6c8122132b531a4338b116d87424
2023-10-16 08:04:25 +00:00

24 lines
657 B
JavaScript

import App from '../../../base'
import { react2angular } from 'react2angular'
import _ from 'lodash'
import { rootContext } from '../../../shared/context/root-context'
import FileView from '../components/file-view'
export default App.controller('FileViewController', [
'$scope',
'$rootScope',
function ($scope, $rootScope) {
$scope.file = $scope.openFile
$scope.storeReferencesKeys = newKeys => {
const oldKeys = $rootScope._references.keys
return ($rootScope._references.keys = _.union(oldKeys, newKeys))
}
},
])
App.component(
'fileView',
react2angular(rootContext.use(FileView), ['storeReferencesKeys', 'file'])
)