nebular icon indicating copy to clipboard operation
nebular copied to clipboard

NbDialog not returning input value

Open diego-rapoport opened this issue 3 years ago • 0 comments

Issue type

nbdialog not working properly

I'm submitting a ... (check one with "x")

  • [x] bug report
  • [ ] feature request

Issue description

I have a basic component to be rendered with this.dialogService(CSRDialogComponent) Implemented onClose.subscribe...but it doesn't take the text. Nor with console.log()or saving into another variable.

@Component({
  selector: 'ngx-csrdialog',
  templateUrl: './csrdialog.component.html',
  styleUrls: ['./csrdialog.component.scss'],
})
export class CSRDialogComponent implements OnInit {

  constructor(private dialogRef: NbDialogRef<any>) {
  }
  ngOnInit(): void {
  }
  fecha() {
    this.dialogRef.close();
  }
}

The html:

  <nb-card>
    <nb-card-header>Cole abaixo o CSR completo</nb-card-header>
    <nb-card-body>
        <textarea nbInput rows="25" cols="70"></textarea>
        <br>
        <br>
        <button nbButton (click)="fecha()">Adicionar CSR</button>
    </nb-card-body>
  </nb-card>

fecha() is the function that only applies this.dialogRef.close() and it works

Current behavior:

txt keeps undefined, function works properly

Expected behavior:

txt has the input expected

Steps to reproduce:

Just use this component along with the one which will use dialogservice.open()

Other information:

npm, node, OS, Browser

Angular CLI: 12.1.0
Node: 14.19.1
Package Manager: npm 8.5.1
OS: arch linux x64

Angular: 12.1.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, google-maps, language-service, platform-browser
... platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1201.0
@angular-devkit/build-angular   12.1.0
@angular-devkit/core            12.1.0
@angular-devkit/schematics      12.1.0
@schematics/angular             12.1.0
rxjs                            6.6.2
typescript                      4.2.3

I'm using Firefox

diego-rapoport avatar Apr 13 '22 13:04 diego-rapoport