2016-04-19 8 views
-2

私はこのウェブサイトのように、モーダルウィンドウ開いて別のルーティングをしたいと思いhttp://architizer.com/projects/rauchkuchlhaus-auf-der-seewiese-am-schliersee-1/モーダルウィンドウを動的コンテンツを開いてURLを変更するにはどうすればいいですか?

+0

のための一般的な質問に答えを見つけることができますか?あなたの質問を読んだユーザーは、このウェブサイトから離れることなく、あなたが望むものを正確に把握する必要があります。 –

答えて

1

フローは次のとおりです。

  1. は、モーダルウィンドウの
  2. onEnterプロパティ(内部
  3. 入れモーダルオープニング・ロジックが実行されますが、ルート状態を作成します。ルートが現在の状態に変更されたとき)。
  4. 最後に、すべてのアイテム(新しいモーダルを開く必要があります)には、必要なパラメータ付きのルートを変更するための参照が必要ですui-sref="home({foo: 'fooVal1'})"

あなたはより説明的だろui-router modal

$stateProvider.state("items.add", { 
url: "/add", 
onEnter: ['$stateParams', '$state', '$modal', '$resource', function($stateParams, $state, $modal, $resource) { 
    $modal.open({ 
     templateUrl: "items/add", 
     resolve: { 
      item: function() { new Item(123).get(); } 
     }, 
     controller: ['$scope', 'item', function($scope, item) { 
      $scope.dismiss = function() { 
      $scope.$dismiss(); 
      }; 

      $scope.save = function() { 
      item.update().then(function() { 
       $scope.$close(true); 
      }); 
      }; 
     }] 
    }).result.finally(function() { 
     $state.go('^'); 
    }); 
}] 
}); 
関連する問題