2
中的舊Ui-Bootrap模式在ng1中,可能沒有任何指令直接在我的頁面上調用從其他位置定義的模態。可能使用Kendo Ui Ng2 Modal,如ng1
我已經創建了自己的模態服務,我定義了許多模態,並且能夠從注入服務的每個視圖中打開它們。我的服務功能之一
例如打開一個模式
public editTodoItem(id: Number): ng.IPromise<My.ITodoCreateViewModel> {
var options: ng.ui.bootstrap.IModalSettings = {
templateUrl: 'Todo/TodoEditModal',
bindToController : true,
controller: "todoEditModalCtrl",
controllerAs : 'ctrl',
size: 'lg',
backdrop: "static",
resolve: {
todoId:() => id
}
};
return this.$uibModal.open(options).result
.then((updatedItem: My.ITodoCreateViewModel) => {
return updatedItem;
});
}
https://angular-ui.github.io/bootstrap/#/modal
,當我關閉的模態,它返回一個承諾,我可以用調用函數還發送一些數據。
這對Kendo Ui的Modal來說也是可能的嗎?
從UI引導新實施NG2似乎有實現此功能已經
https://ng-bootstrap.github.io/#/components/modal