将 UI-Bootstrap 模式迁移到基于组件的模式
Migrating UI-Bootstrap modal to component based
我正在研究 UI-Router 和 UI-Bootstrap 模态并且遇到了问题。 cloned one from UI-Bootstrap tutorial works fine, but when migrating to the component based version 我遇到了问题:它不显示模态 window。哪位大神帮忙看看是什么问题。
您应该重构函数声明如下:
来自 var modalDemoCtrl = function($scope, $uibModal, $log, $document)
至 function modalDemoCtrl($scope, $uibModal, $log, $document)
来自var ModalInstanceCtrl = function($uibModalInstance)
至 function ModalInstanceCtrl()
这样您就可以在文件中引用之前代码中的函数。
此外,您不应该将 $uibModalInstance
传递给 ModalInstanceCtrl
。
我正在研究 UI-Router 和 UI-Bootstrap 模态并且遇到了问题。 cloned one from UI-Bootstrap tutorial works fine, but when migrating to the component based version 我遇到了问题:它不显示模态 window。哪位大神帮忙看看是什么问题。
您应该重构函数声明如下:
来自 var modalDemoCtrl = function($scope, $uibModal, $log, $document)
至 function modalDemoCtrl($scope, $uibModal, $log, $document)
来自var ModalInstanceCtrl = function($uibModalInstance)
至 function ModalInstanceCtrl()
这样您就可以在文件中引用之前代码中的函数。
此外,您不应该将 $uibModalInstance
传递给 ModalInstanceCtrl
。