I use angular-ui-router and angular-bootstrap in my project.
I want to implement follow use case:
When user click to "edit" button, UI-Router change URL and open modal window. When I go back by click on browser's back button, modal window is closing.
If user reload page when modal window is opened, application should render modal window content in main ui-view container.
This use case you can see on this sire: http://canopy.co/ (try to click on item and reload page)
Question: How to implement behaviour described above?
Here is my jsFiddle http://jsfiddle.net/sloot/ceWqw/3/
var app = angular.module('myApp', ['ui.router', 'ui.bootstrap'])
.config(function ($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/');
$stateProvider
.state('app', {
url: '/',
controller: 'AppCtrl',
templateUrl: '/views/app.html'
})
.state('item', {
url: '/profile',
controller: 'ItemCtrl',
templateUrl: '/views/item.html'
});
})
.controller('AppCtrl', function($scope, $modal, $state){
$scope.open = function(){
// open modal whithout changing url
$modal.open({
templateUrl: '/views/item.html'
});
// I need to open popup via $state.go or something like this
};
})
.controller('ItemCtrl', function(){});