当前位置: 首页> 健康> 美食 > 新手如何涨1000粉_站长之家seo_口碑营销5t_近期新闻热点

新手如何涨1000粉_站长之家seo_口碑营销5t_近期新闻热点

时间:2025/7/9 4:40:30来源:https://blog.csdn.net/cf8833/article/details/143434840 浏览次数:1次
新手如何涨1000粉_站长之家seo_口碑营销5t_近期新闻热点

说明:
angular实现dialog弹窗
效果图:

step1:E:\projectgood\ajnine\untitled4\src\app\apple\apple.component.html

<button mat-button (click)="openDialog()">Open dialog</button>

step2:E:\projectgood\ajnine\untitled4\src\app\apple\apple.component.ts

import {Component, inject} from '@angular/core';
import {MatButton, MatButtonModule} from '@angular/material/button';
import {MatDialog, MatDialogModule} from '@angular/material/dialog';
import {DialogContentExampleDialog} from './DialogContentExampleDialog';@Component({selector: 'app-apple',standalone: true,imports: [MatButton, MatButtonModule, MatDialogModule],templateUrl: './apple.component.html',styleUrl: './apple.component.css'
})
export class AppleComponent {readonly dialog = inject(MatDialog);openDialog() {const dialogRef = this.dialog.open(DialogContentExampleDialog);dialogRef.afterClosed().subscribe(result => {console.log(`Dialog result: ${result}`);});}}

step3:E:\projectgood\ajnine\untitled4\src\app\apple\dialog-content-example-dialog.html

<h2 mat-dialog-title>Install Angular</h2>
<mat-dialog-content class="mat-typography"><h3>Develop across all platforms</h3><p>{{ cancelString }}</p><p>{{ sureString }}</p>
</mat-dialog-content>
<mat-dialog-actions align="end"><button mat-button [mat-dialog-close]="cancelString">Cancel</button><button mat-button [mat-dialog-close]="sureString">Install</button>
</mat-dialog-actions>

step4:E:\projectgood\ajnine\untitled4\src\app\apple\DialogContentExampleDialog.ts

import {ChangeDetectionStrategy, Component, OnInit} from '@angular/core';
import {MatDialogModule} from '@angular/material/dialog';
import {MatButtonModule} from '@angular/material/button';@Component({selector: 'dialog-content-example-dialog',templateUrl: 'dialog-content-example-dialog.html',standalone: true,imports: [MatDialogModule, MatButtonModule],changeDetection: ChangeDetectionStrategy.OnPush,
})
export class DialogContentExampleDialog implements OnInit{cancelString :string=''sureString :string=''ngOnInit(): void {this.cancelString="鲨鱼哟"this.sureString="昊昊超体"}}

end

关键字:新手如何涨1000粉_站长之家seo_口碑营销5t_近期新闻热点

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: