我希望父控制器在状态从子级更改为父级时再次解析其注入。
.state('settings.billing', {
url: '/billing',
controller: 'BillingCtrl as vm',
template: require('./templates/billing.tpl.jade'),
resolve: {
sources: function(StripeService) {
return StripeService.getSources();
}
}
})
.state('settings.billing.newsource', {
url: '/add-source',
onEnter: showAddSourceModal
})
function showAddSourceModal($state, $modal) {
$modal.open({
template: require('./templates/add-source.tpl.jade')(),
controller: 'AddSourceCtrl as vm',
backdrop: true,
keyboard: true,
size: 'md'
})
.result
.finally(function() {
$state.go('^');
});
}
基本上我想要在关闭模态时再次调用BillingCtrl的源代码。有可能吗?