Base solution for your next web application
Open Closed

Angular Newbie: How to debug show Modal #5304


User avatar
0
rvanwoezik created

Hi, excuse me for maybe a stupid question, but i have created an modal.component like the create-or-edit-user-modal.component which i open from dropdown in datatable

<div class="btn-group dropdown" normalizePosition>
                                 <button class="dropdown-toggle btn btn-sm btn-primary"
                                                    data-toggle="dropdown"
                                                    aria-haspopup="true"
                                                    aria-expanded="false">
                                                <i class="fa fa-cog"></i><span class="caret"></span> {{l("Actions")}}
                                            </button>
                                            <ul class="dropdown-menu">
                                                <li>
                                                    <a *ngIf="permission.isGranted('Pages.Tenant.Hrm.Employees.Edit')"
                                                       (click)="editEmployeeModal.show(record.id)">{{l('Edit')}}</a>
                                                </li>
                                               
                                            </ul>
                                        </div>

And in my edit-employee-modal.component.ts

show(employeeId?: number): void {
        this._employeeService.getEmployeeForEdit(employeeId).subscribe(employeeResult => {
            this.employee = employeeResult.employee;

            this.getProfilePicture(employeeResult.profilePictureId);

        });
    }

My application layer returns the correct EmployeeEditDto but my Modal doesn't open, no errors in browser console nothing.

What am i missing? How can i debug the show?


2 Answer(s)
  • User Avatar
    0
    yekalkan created

    Adding the lines below to show method may help.

    this.active = true;
    	this.modal.show();
    
  • User Avatar
    0
    rvanwoezik created

    <cite>yekalkan: </cite> Adding the lines below to show method may help.

    this.active = true;
      this.modal.show();
    

    Thanks! that was stupid ;-)