angularjs - angular-modal-service: "closeDeferred is null" and multiple instances -
i'm using library angularjs show custom modals: https://github.com/dwmkerr/angular-modal-service
i ran problem when trying close modal $rootscope
watch.
this controller modal want close:
app.controller('playlistmodalcontroller', function($scope, $rootscope, modalservice, close, playlist) { $scope.playlist = playlist; $scope.close = close; $scope.queuesong = function(song) { modalservice.showmodal({ templateurl: "templates/modals/confirm_queue.html", controller: "confirmqueuecontroller", inputs: { song: song } }); } $rootscope.$on("idleenter", function() { console.log(close) $scope.close(); }); });
the modal closes on 'idleenter' event , doesn't produce error , if it's first time event fired. when re-open model , event fired again produces error:
error: closedeferred null cleanupclose@[...]/angular-modal-service.js:179:14 close/<@[...]/angular-modal-service.js:133:18 timeout/timeoutid<@[...]/angular.js:19612:28 completeoutstandingrequest@[...]/angular.js:5964:7 browser/self.defer/timeoutid<@[...]/angular.js:6243:7
i mentioned close function printed out opened modal before. seems modal scope not 'cleared' properly...?!
note: 'queuesong' function doesn't have called reproduce problem.
this code use create modal:
$scope.openplaylist = function(playlist) { modalservice.showmodal({ templateurl: "templates/modals/playlist.html", controller: "playlistmodalcontroller", inputs: { playlist: playlist } }); };
can tell me problem is?
doing wrong or bug?
thanks!
Comments
Post a Comment