angular.module('ObserverService', [])
  .service('ObservableService', function(){

    function Observable(content){
      this.content = content;
      this.observers = {};
    }

    Observable.prototype.getContent = function(){
      return this.content;
    };

    Observable.prototype.setContent = function(content){
      this.content = content;
      this.notify();
    };

    Observable.prototype.notify = function(){
      angular.forEach(this.observers, function(callback){
        callback(this.content);
      });
    };

    Observable.prototype.addObserver = function(callback){
      var handle = this.generateRandomString();
      this.observers[name] = callback;
      return handle;
    };

    Observable.prototype.removeObserver = function(name){
      delete this.observers[name];
    };

    Observable.prototype.generateRandomString = function(){
      var text = "",
      possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

     for( var i=0; i < 5; i++ ) {
       text += possible.charAt(Math.floor(Math.random() * possible.length));
     }
     return text;
    };

    return Observable;


  });

@@ -79,191 +79,648 @@
 ()%7B%0A
-%0A    function Observable(content)%7B%0A      this.content = content;%0A      this.observers = %7B%7D;%0A    %7D%0A%0A    Observable.prototype.getContent = function()%7B%0A      return this.content;%0A    %7D;%0A
+    var observables = %7B%7D;%0A%0A    /**%0A     * Observable constructor%0A     *%0A     * @param %7B*%7D content    The content to observe changes to.%0A     * @constructor%0A     */%0A    function Observable(content)%7B%0A      this.content = content;%0A      this.observers = %7B%7D;%0A    %7D%0A%0A    /**%0A     * Get content from observable.%0A     *%0A     * @return %7B*%7D The content to observe changes to.%0A     */%0A    Observable.prototype.getContent = function()%7B%0A      return this.content;%0A    %7D;%0A%0A    /**%0A     * Update the content in the observable.%0A     *%0A     * @param  %7B%5Btype%5D%7D content The content to observe changes to.%0A     * @return %7B%5Btype%5D%7D         %5Bdescription%5D%0A     */
 %0A   
@@ -824,32 +824,115 @@
 tify();%0A    %7D;%0A%0A
+    /**%0A     * Notify observers the content of the observable has changed.%0A     */%0A
     Observable.p
@@ -1061,32 +1061,271 @@
     %7D);%0A    %7D;%0A%0A
+    /**%0A     * Add a new observer callback.%0A     *%0A     * @param  %7BFunction%7D callback   The callback to call on change of the observable content.%0A     * @return %7BString%7D              The handle for the observer which was rendered.%0A     */%0A
     Observable.p
@@ -1436,19 +1436,21 @@
 servers%5B
-nam
+handl
 e%5D = cal
@@ -1477,32 +1477,191 @@
 handle;%0A    %7D;%0A%0A
+    /**%0A     * Remove an observer from an observable.%0A     *%0A     * @param  %7B%5Btype%5D%7D handle %5Bdescription%5D%0A     * @return %7B%5Btype%5D%7D        %5Bdescription%5D%0A     */%0A
     Observable.p
@@ -1695,19 +1695,21 @@
 unction(
-nam
+handl
 e)%7B%0A    
@@ -1736,11 +1736,13 @@
 ers%5B
-nam
+handl
 e%5D;%0A
@@ -2073,20 +2073,420 @@
 urn 
-Observable;%0A
+%7B%0A      createObservable: createObservable,%0A      getObservable: getObservable,%0A      deleteObservable: deleteObservable%0A    %7D;%0A%0A    function createObservable(name, content)%7B%0A      observables%5Bname%5D = new Observable(content);%0A      return observables%5Bname%5D;%0A    %7D%0A%0A    function getObservable(name)%7B%0A      return observables%5Bname%5D;%0A    %7D%0A%0A    function deleteObservable(name)%7B%0A      delete observables%5Bname%5D;%0A    %7D
 %0A%0A  

Update observables