blob: 0620277e68af8e5595c26be2cf77c89d991de5ec [file] [log] [blame]
Matteo Scandolo388795a2016-02-22 09:57:55 -08001(function () {
2 'use strict';
Matteo Scandolo04564952016-02-24 11:22:48 -08003 angular.module('xos.diagnostic')
Matteo Scandolo388795a2016-02-22 09:57:55 -08004 .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})();