【问题标题】:set current controller in ui.bootstrap.modal在 ui.bootstrap.modal 中设置当前控制器
【发布时间】:2016-03-06 21:15:06
【问题描述】:

如何在模态配置中使用当前控制器? 我在 GestioneTrtController 中,但这会重新初始化我的控制器:

export class GestioneTrtController {
  openModal() {
    this.$modal.open({
        templateUrl: '...,
        controller: GestioneTrtController,
        controllerAs: 'gestTrt',
        bindToController: true
    });
  }
}

【问题讨论】:

    标签: angularjs typescript angular-ui-bootstrap bootstrap-modal


    【解决方案1】:

    将当前范围添加到您的模式

    export class GestioneTrtController {
       openModal() {
         this.$modal.open({
         templateUrl: '...,
         controller: GestioneTrtController,
         controllerAs: 'gestTrt',
         bindToController: true,
         scope : $scope
       });
     }
    }
    

    【讨论】:

      猜你喜欢
      • 2014-04-15
      • 1970-01-01
      • 2016-11-13
      • 2014-01-05
      • 2018-10-03
      • 1970-01-01
      • 2020-10-11
      • 2011-05-19
      • 2015-11-07
      相关资源
      最近更新 更多