GUAC-605: Allow non-root scope for client and tunnel factories.

This commit is contained in:
Michael Jumper
2014-11-14 15:08:34 -08:00
parent 777761a616
commit 1a69a12c61
3 changed files with 14 additions and 4 deletions

View File

@@ -32,9 +32,14 @@ angular.module('client').factory('guacTunnelFactory', ['$rootScope', '$window',
* Returns a new Guacamole tunnel instance, using an implementation that is
* supported by the web browser.
*
* @param {Scope} [$scope] The current scope. If ommitted, the root scope
* will be used.
* @returns {Guacamole.Tunnel} A new Guacamole tunnel instance.
*/
service.getInstance = function getTunnelInstance() {
service.getInstance = function getTunnelInstance($scope) {
// Use root scope if no other scope provided
$scope = $scope || $rootScope;
var tunnel;