reply.controller.js 965 B

1234567891011121314151617181920212223242526272829
  1. (function(){
  2. 'use strict';
  3. app.controller('Reply', ['$rootScope', '$scope', function($rootScope,$scope){
  4. $scope.comment = {authorName: '',
  5. foto: '',
  6. commentText: '',
  7. isEditMod: false,
  8. isReplyMod: false,
  9. secondComments: []
  10. };
  11. $rootScope.$on('Reply', function(evnt, commets, id){
  12. $scope.comment.id = new Date().getTime()
  13. return $scope.comment.mainId = id
  14. });
  15. $scope.replyComment = function(){
  16. $rootScope.$emit('commentReply', $scope.comment, $scope.comment.mainId);
  17. return $scope.comment = {authorName: '',
  18. foto: '',
  19. commentText: '',
  20. isEditMod: false,
  21. isReplyMod: false,
  22. secondComments: []
  23. };
  24. }
  25. $scope.replyCancel = function(){
  26. $rootScope.$emit('cancelReplyMod',$scope.comment.mainId)
  27. }
  28. }])
  29. })()