Matteo Scandolo | 388795a | 2016-02-22 09:57:55 -0800 | [diff] [blame] | 1 | (function () { |
| 2 | 'use strict'; |
| 3 | angular.module('xos.serviceTopology') |
| 4 | .directive('subscriberModal', function(){ |
| 5 | return { |
| 6 | scope: { |
| 7 | subscribers: '=', |
| 8 | open: '=' |
| 9 | }, |
| 10 | bindToController: true, |
| 11 | restrict: 'E', |
| 12 | templateUrl: 'templates/subscriber-modal.tpl.html', |
| 13 | controllerAs: 'vm', |
| 14 | controller: function($rootScope){ |
| 15 | |
| 16 | this.close = () => { |
| 17 | this.open = false; |
| 18 | }; |
| 19 | |
| 20 | this.select = (subscriber) => { |
| 21 | $rootScope.$emit('subscriber.selected', subscriber); |
| 22 | this.close(); |
| 23 | }; |
| 24 | } |
| 25 | }; |
| 26 | }); |
| 27 | })(); |