blob: 0a02b04a9be16ddc6421cb9509d4bdc08e12265e [file] [log] [blame]
Matteo Scandolofcdbed32016-02-08 16:55:44 -08001(function () {
2 'use strict';
3
4 angular.module('xos.serviceTopology')
5 .directive('diagnostic', function(){
6 return {
7 restrict: 'E',
8 templateUrl: 'templates/diagnostic.tpl.html',
9 controllerAs: 'vm',
10 controller: function(Subscribers, ServiceRelation){
Matteo Scandolo7547f042016-02-09 09:13:30 -080011 Subscribers.queryWithDevices().$promise
Matteo Scandolofcdbed32016-02-08 16:55:44 -080012 .then((subscribers) => {
Matteo Scandolo7547f042016-02-09 09:13:30 -080013 console.log(subscribers);
Matteo Scandolofcdbed32016-02-08 16:55:44 -080014 this.subscribers = subscribers;
Matteo Scandolo7547f042016-02-09 09:13:30 -080015 return ServiceRelation.get(subscribers[0]);
Matteo Scandolofcdbed32016-02-08 16:55:44 -080016 })
17 .then((serviceChain) => {
18 this.serviceChain = serviceChain;
19 });
20 }
21 }
22 });
23})();