title: Changing routes dynamically in angular and appending content
body: <p>I have setup a special route for angular that is a single route for many static pages, (think privacy policy, client html, that I would like my clients to be able to drop in a folder as a html page and it dynamically load it with routing.</p>
  
  <p>When you type something in the address bar I am telling angular to go look in a directory and find a <strong>.html</strong> file with the <strong>$routeParams.name</strong> and load it.</p>
  
  <p>This works great but I am replacing the data onto a blank page.  <strong>blank.html</strong></p>
  
  <p><strong>App.js</strong></p>
  
  <pre><code>.config(function($routeProvider, $locationProvider) {
  $locationProvider.html5Mode(true);
  
  $routeProvider.when('/test', {
    controller : 'AppRepeatCtrl',
    templateUrl : './templates/test_tpl.html'
  }).when('/:name', { 
    controller: 'DynamicRoutes',
    templateUrl: 'partials/blank.html'
  }).otherwise({
    redirectTo: '/'
  });
  </code></pre>
  
  <p>})</p>
  
  <p><strong>Controllers.js</strong></p>
  
  <pre><code>function DynamicRoutes ($scope, $http, $location, $route, $routeParams, $compile, appLoading) {
    if ($routeParams.name == '' ) {
       $route.current.templateUrl = 'partials/' + "home.html";
    }  else {
       $route.current.templateUrl = 'partials/' + $routeParams.name + ".html";
    }
  
    $http.get($route.current.templateUrl).then(function (msg) {
      if (msg.data.contains('html')) {
          $http.get('partials/error.html').then(function (msg) {
              $('#ng-view').html($compile(msg.data)($scope));
          });
      } else {
          appLoading.ready();
          $('#ng-view').html($compile(msg.data)($scope));
  
      }
  });
  };
  </code></pre>
  
  <p>My question is,
  is there any way to load the page up from the partial without having to load the blank template and then  replace the html with the static page.  Because I am doing animation, the animations are getting borked because of the replace.  I really need to load in a page without having to replace a blank.html template page, or replace the blank.html BEFORE the views start ng-animate</p>
  
  <p><strong>$('#ng-view').html($compile(msg.data)($scope));</strong> is what I think is causing the page to replace html without the ng-animate enter-view finishing up.</p>
  
  <p>because if you change it to $('#ng-view').append($compile(msg.data)($scope));</p>
  
  <p>you can see 2 x  and 1 has the animation but as soon as the append happens the animation stops.</p>