简体   繁体   中英

how to resize dialogue angular 2

I was following this example plnkr . How can I resize the model (pop up dialogou). I just wanted to know where to add height and width.

Just change style for .modal-dialog div in modal.component.ts :

<div class="modal-dialog" style="width: 200px">
                            ^^^^^^^^^^^^

Plunker Example

You can also set this value dynamically using @Input property

@Component({
  selector: 'app-modal',
  template: `
     ...
    <div class="modal-dialog" [style.width.px]="width">
     `
})
export class ModalComponent {
  @Input() width;

and then in your parent component:

<app-modal #modal1 [width]="200">

Plunker Example

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM