Hello i found code example shows how to open modal window in certain state: https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions#how-to-open-a-dialogmodal-at-a-certain-state
but i have not got idea how to inject $modal and $scope into :
angular.module('my-module',['ui-router']).config(function($stateProvider, $modal, $scope))
this is not working, i also read : how to inject dependency into module.config(configFn) in angular
So i know that we can only inject provider and constants. But how to run that example :
`$stateProvider.state("items.add", {
url: "/add",
onEnter: 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.then(function(result) {
if (result) {
return $state.transitionTo("items");
}
});
}`
P.S My goal is to open new module window when user change url address..