javascript - Open Modal and change URL without change the view in AngularJS -



javascript - Open Modal and change URL without change the view in AngularJS -

i'm trying open modal angularjs.

my route task list is:

/client/:id/task/list

its working fine. now, i'm trying show task info in modal, above list.

my route is:

/client/:id/task/:id

how can open modal above list view, alter url, don't alter view?

i saw lot of topics this, none solution.

thanks.

you can specify states want show modal , when handled, homecoming state want to. example;

app.config(function ($stateprovider) { $stateprovider.state('tasks', { url: '/tasks', templateurl: 'tasks.html', controller: 'tasksctrl' }).state("tasks.show", { url: "/tasks/:id", onenter: function($stateparams, $state, $modal) { $modal.open({ templateurl: "show.html", resolve: {}, controller: function($scope, $state) { $scope.ok = function () { $scope.$close(); }; $scope.dismiss = function () { $scope.$dismiss(); }; } }).result.then(function (result) { // $scope.$close }, function (result) { // $scope.$dismiss }).finally(function () { // homecoming $state.transitionto("tasks"); }); } }); });

related plunker here http://plnkr.co/edit/fcyrlh

javascript angularjs angular-ui-router

Comments

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -