word-count-modal-controller.js 652 B

12345678910111213141516171819202122232425262728
  1. import App from '../../../base'
  2. import { react2angular } from 'react2angular'
  3. import WordCountModal from '../components/word-count-modal'
  4. import { rootContext } from '../../../shared/context/root-context'
  5. export default App.controller('WordCountModalController', function ($scope) {
  6. $scope.show = false
  7. $scope.handleHide = () => {
  8. $scope.$applyAsync(() => {
  9. $scope.show = false
  10. })
  11. }
  12. $scope.openWordCountModal = () => {
  13. $scope.$applyAsync(() => {
  14. $scope.show = true
  15. })
  16. }
  17. })
  18. App.component(
  19. 'wordCountModal',
  20. react2angular(
  21. rootContext.use(WordCountModal),
  22. Object.keys(WordCountModal.propTypes)
  23. )
  24. )