title: get the old value of the scope
body: <p>By this code I'm trying to take a copy of event before editing or any changing in the event view to implement cancel button , so I copied it to oldValue variable, but the event and oldValue are always empty because ( as I think ) they execute before the return of the event factory that fills the event variable</p>
  
  <p>what can I do to solve this problem ?</p>
  
  <p>Event html</p>
  
  <pre><code>&lt;sw-event-view event="ev.event" ng-hide="ev.loading" ng-if="ev.view_type == 'event'" &gt;&lt;/sw-event-view&gt;
  </code></pre>
  
  <p>Event controller</p>
  
  <pre><code>angular.module('App')
         .controller('EventCtrl', function ($scope, $state, $http, EventFactory) {
              ev.event = {};
  
              console.log('controller start');
              ev.view_type = 'event';
              EventFactory.getEvent(1)
                         .then( function(r) { 
                                      ev.event = r.data.data.event;
                                      console.log('event controller',ev.event);
                                      ev.loading = false; 
                           } ,handleHttpError);
               console.log('end of controller');
  
  }
  </code></pre>
  
  <p>event view html</p>
  
  <pre><code>&lt;div&gt;Something&lt;/div
  &lt;sw-basic-info ng-show="!edit_mode &amp;&amp; selected_tab == 'basic info'" event="event"&gt;&lt;/sw-basic-info&gt; 
  
  &lt;sw-locations-list ng-show="(selected_tab == 'locations') &amp;&amp; !edit_mode" locations="event.locations"&gt;&lt;/sw-locations-list&gt;
  </code></pre>
  
  <p>event view directive </p>
  
  <pre><code>angular.module('App')
         .directive('swEventView', function (EventFactory) {
           return {
              scope: {
                 event: "=", 
             },
           templateUrl: 'template url',
           restrict: 'E',
           link: function (scope, element, attrs) {
               console.log('event view scope.event', scope.event);
               scope.oldValue = angular.copy(scope.event);
               console.log('event view scope.oldValue', scope.oldValue);
           }
     }
  </code></pre>
  
  <p>event factory </p>
  
  <pre><code>angular.module('App')
         .factory('EventFactory', function ($http, $q) {
  
              var getEvent = function (id) {
                                console.log('event factory', id);
                                return $http.get(server + "event/"+id);
                } 
  </code></pre>
  
  <p>}</p>
  
  <p>Thats what I see in the Log</p>
  
  <pre><code>controller start
  event factory 1
  end of controller
  event view scope.event Object {}
  event view scope.oldValue Object {}
  
  event controller
  Object {id: 1, event_code: "5020048072", name: "Heathcote", short_name: "Hea", description: "Dolor unde molestiae fuga culpa aut excepturi iste et esse tempore illo quia quod aut."…}
  </code></pre>