code: function MainCtrl($scope, $location) {
  
      $scope.select = function select(id) {
        $scope.selected = $scope.selected === id ? null : id;
        $location.path('/' + id);
      };
  
      $scope.examples = examples;
      $scope.select($location.path().substring(1) || examples[0].id);
  
    }
docs: Controls the example navigation