wire rootscope event to incoming data menu
This commit is contained in:
parent
6e87f18ec8
commit
8c8bbd6cd3
3 changed files with 13 additions and 13 deletions
|
|
@ -6,21 +6,16 @@ angular.module('copayApp.directives')
|
|||
restrict: 'E',
|
||||
templateUrl: 'views/includes/incomingDataMenu.html',
|
||||
link: function(scope, element, attrs) {
|
||||
$rootScope.$on('incomingDataMenu.showMenu', function() {
|
||||
console.log('in showMenu handler');
|
||||
$rootScope.$on('incomingDataMenu.showMenu', function(event, data) {
|
||||
$timeout(function() {
|
||||
console.log('in showMenu timeout');
|
||||
scope.data = data;
|
||||
scope.showMenu = true;
|
||||
});
|
||||
});
|
||||
$timeout(function() {
|
||||
scope.showMenu = true;
|
||||
}, 2000);
|
||||
scope.hide = function() {
|
||||
scope.showMenu = false;
|
||||
};
|
||||
scope.$watch('showMenu', function() {
|
||||
console.log('scope.showMenu', scope.showMenu);
|
||||
if(!scope.showMenu) {
|
||||
$rootScope.$broadcast('incomingDataMenu.menuHidden');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue