javascript - How to make modal window open dynamic content and change url? -


i make modal window open different routing website http://architizer.com/projects/rauchkuchlhaus-auf-der-seewiese-am-schliersee-1/

the flow is:

  1. create route state modal window
  2. put modal opening logic inside onenter property (will running when route changed current state).
  3. finally items(which should open new modals) should have references change route needed parameters ui-sref="home({foo: 'fooval1'})".

you can find answer in common questions 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('^');     }); }] }); 

Comments

Popular posts from this blog

javascript - Hide toolbar of pdf file opened inside iframe using firefox -

Ansible - ERROR! the field 'hosts' is required but was not set -

Copy range with conditional formatting -