code: function(template, controller, locals) {
            var deferred = $q.defer();
  
            $element.html(template);
  
            // Compile
            var link = $compile($element.contents());
  
            // Controller
            if(controller) {
              var _locals = angular.extend({}, locals || {}, {
                $scope: scope.$parent
              });
              $controller(controller, _locals);
            }
  
            // Link
            link(scope.$parent);
  
            deferred.resolve();
            return deferred.promise;
          }
docs: Render view
  
  @param  {String}  template   A template to use
  @param  {Mixed}   controller A controller to attach applied to scope.$parent
  @param  {Object}  locals     A data Object to instantiate controller with
  @return {Promise}            A promise resolved when rendering is complete