2015-07-20 50 views
0

去一個HTML頁面上,我有這樣的:Angular.copy,文不通過

<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> 

這個網站導致這個網站:

<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> 

這是相關的東西在我的控制器..

$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); 
        }; 



       } 


        }]); 

我的問題是,在預 - JSON沒有資料看起來都好像editNote不發送任何東西。我試過很多DIF但我想我沒有解決它我的自我...

+0

請格式化你的問題和代碼以可讀格式。 – Wawy

回答

0

相似答案我有answered already

你需要通過在$mdDialog.hide(someData);

的數據,然後您會收到它

$mdDialog.show({ 
    controller: DialogNoteFullscreenController, 
    templateUrl: 'views/schedule/note-fullscreen.html', 
    targetEvent:event, 
    locals: { 
    editNote: angular.copy($scope.noteEdit) 
    }   
}).then(function (someData) { 
    console.log(someData); 
}); 
+0

即時通訊不知道你明白我的問題,而不是從editNote.note_value接收數據的信息,我收到一個空的對象[object Object] – omer