As mentioned in the header, I would like to return the promise in the template function of the ie directive:
angular.module('someModule', []) //... .directive('someDirective', function() { return { //... restrict: 'E', template: function() { var deferred = $q.defer(); //Some Async function which will call deferred.resolve return deferred.promise; //Promise not supported by template property } }; });
Since the template property does not support this, is there any (simple) way to "emulate" this?
It seems like the solution is my best bet, but it's hard for me to find a suitable way to apply the template downloaded from WebSocket in the resolution method.
My goal is to use one WebSocket connection for all communications.
source share