Ciro
Ciro

Reputation: 263

set current controller in ui.bootstrap.modal

How can I use the current controller in the modal configuration? I am in GestioneTrtController but this re-initialize my controller:

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

Upvotes: 0

Views: 381

Answers (1)

IARKI
IARKI

Reputation: 197

Add current scope to your modal

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

Upvotes: 1

Related Questions