0

on one html page i have this:

<md-button data-ng-if="true"
                    aria-label="note full screen"
                       class="wm-note-builder-panel-button"
                        ga-track-event="['notes', 'click', 'fullscreen']"
                       data-ng-click="notefullScreen()"

                       >
                   <ng-md-icon  icon="fullscreen"  size="16"></ng-md-icon>
                </md-button>

this html leads to this html :

 <pre>{{editNote.note_value|json}}</pre>
    </div>
    <div>

   <textarea  wm-elastic-text-area
              rows="5" 
             class="textarea"
             ng-model="noteEdit.note_value" 
             ng-style="{'min-height':((noteEdit.note_value.split('\n').length - 1) * 18 + 75) + 'px'}"
             ></textarea>

   <div flex="" layout="row" layout-align="end end">
                    <div><md-button 
                        style="padding: 11px;
                                width: 42px;
                                height: 42px;"

                      class="md-fab" 
                      data-ng-style="{'background-color': (!noteEdit.note_value || noteEdit.note_value.trim().length === 0) && 'rgba(0, 0, 0, 0.33)'}"
                        ng-disabled="!noteEdit.note_value || noteEdit.note_value.trim().length === 0"
                        aria-label="Add Note"
                        ng-click="addNoteFromExtendedMode()"  

                        ga-track-event="['note-fullscreen', 'click', 'add note']"
                        ng-if="noteEdit.note_value!==0"
                        ng-add=""

                        >
                        <ng-md-icon icon="send" style="fill:white;" size="20"></ng-md-icon> 

                    </md-button>


                  </div>
                </div>

this is the relevant stuff in my controller..

$scope.notefullScreen=function(event){

                            $mdDialog.show({
                            controller: DialogNoteFullscreenController,
                            templateUrl: 'views/schedule/note-fullscreen.html',
                            targetEvent:event,
                            locals: {
                                editNote: angular.copy($scope.noteEdit) 
                            }        


                        }).then(function () {

                            }, function () {

                            });


                    };

 $scope.$on('onExtendedNoteAdd', function(event, data) {

                        $scope.noteEdit=data;
                        console.log(data);

                        $scope.addNote();

                      });



                 //################################
                //   DialogController
                //################################


                    function DialogNoteFullscreenController($rootScope, $scope, $mdDialog,editNote) {

                       $scope.editNote = editNote;
                       $scope.editNote.note_value = editNote.note_value || "";


                    $scope.hideExtenedNote = function () {
                        $mdDialog.hide();
                    };

                    $scope.cancelExtenedNote = function () {
                        $mdDialog.cancel();
                    };

                    $scope.answerExtenedNote = function (answer) {
                        $mdDialog.hide(answer);
                    };
                    $scope.addNoteFromExtendedMode= function(){
                       $rootScope.$broadcast('onExtendedNoteAdd',  $scope.editNote);
                    };



                }


                    }]);

my problem is that on the pre - json no info appear to come as if the editNote doesn't send anything back.. i tried many different things but i guess im not solving it my self...

Gimby
  • 5,095
  • 2
  • 35
  • 47
omer
  • 2,435
  • 2
  • 24
  • 28

1 Answers1

0

similar answer I have answered already.

you need to pass the data in $mdDialog.hide(someData);

and then you receive it in

$mdDialog.show({
  controller: DialogNoteFullscreenController,
  templateUrl: 'views/schedule/note-fullscreen.html',
  targetEvent:event,
  locals: {
    editNote: angular.copy($scope.noteEdit) 
  }        
}).then(function (someData) {
  console.log(someData);
});
Community
  • 1
  • 1
atinder
  • 2,080
  • 13
  • 15
  • im not sure you understand my problem, instead of receving the information back in data from editNote.note_value i receive an empty object [object Object] – omer Jul 20 '15 at 12:39