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

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

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -