当前位置: 首页 > 工具软件 > NG Bootstrap > 使用案例 >

angular模态框位置_angular2 ngbootstrap 模态框用法

赵同
2023-12-01

import {Component, ViewEncapsulation} from "@angular/core";

import {NgbModal} from '@ng-bootstrap/ng-bootstrap';

@Component({

selector: 'model-test',

encapsulation: ViewEncapsulation.None,

styles: [`

.dark-modal .modal-content {

background-color: #2b669a;

color: white;

}

`],

templateUrl: './model.component.html'

})

export class ModelTestComponent {

username: string;

password: string;

model: any;

constructor(private modalService: NgbModal) {}

open(content) {

this.model = this.modalService.open(content, { windowClass: 'dark-modal',size: 'lg'});

}

submit() {

this.model.close();

}

}

打开模态框

 类似资料: