title: how to make $urlRouterProvider.otherwise route to external url
body: <p>i have .js file as below</p>
  
  <pre><code>routerApp.config(function ($stateProvider, $urlRouterProvider) { 
      $urlRouterProvider.otherwise(function ($injector, $location) {
      var $state = $injector.get('$state');
      var path = $location.protocol();
      if (path == 'http') {
         $state.go('external');
      }
      else {
          return '/home';
      }
  });
  
  $stateProvider
  
      // HOME STATES AND NESTED VIEWS ========================================
      .state('home', {
          url: '/home',
          templateUrl: 'routing.html'
      })
      .state('external', {
          onEnter: function ($window) {
           $window.open('http://www.google.com', '_self');
          }
      });
  </code></pre>
  
  <p>});</p>
  
  <p>above code works fine when path != 'http', it will redirect to routing.html. But when path == 'http', it should call external state and redirect to external url. Here path == 'http' condition is not working. How to call external url here? and in state I am calling external onEnter. Can I do it without OnEnter?</p>