我在角度2项目中使用角度材料.我想在mat-select的选定值中放置一个静态图像(html元素).但我没有找到解决方案.
有人能帮我吗?
我正在使用Node js后端做angualar 4应用程序。我做了登录表单,一切都很好,我想实现该功能,请记住我。先感谢您。这是我的登录服务:
import { Injectable } from '@angular/core';
@Injectable()
export class loginService{
rememberMe: boolean;
constructor() { }
login(credentials) {
sessionStorage.setItem('Name', credentials.firstName);
sessionStorage.setItem('token', credentials.token);
}
getCostumer() {
const user = {
Name: sessionStorage.getItem('firstName'),
token: sessionStorage.getItem('token')
}
Run Code Online (Sandbox Code Playgroud)
这是组件:
constructor(private signInService: SignInService, private router: Router,
public dialog: MatDialog, private authService: AuthService) { }
ngOnInit() { }
login(costumer) {
this.loginService.login(costumer).subscribe((data) => {
this.authService.login(data);
this.router.navigate(['home']);
this.dialog.closeAll();
}, err => {
this.message = err._body;
console.log(this.message);
});
}
}
Run Code Online (Sandbox Code Playgroud) javascript local-storage typescript angular2-template angular
我使用 swagger-ui-express 模块为我的节点 js 后端构建了一个 swagger。我有一个返回文件(pdf-doc 或 xlsx)的端点。当我在 swagger 上测试我的端点时,它会返回 200 个响应,并且始终在正文中显示此消息“无法识别的响应类型;将内容显示为文本。这是我的 swagger 端点的代码。
"/reports?typeDoc={typeDoc}&file={file}": {
"get": {
"tags": [
"Generate report"
],
"description": "",
"operationId": "",
"parameters": [
{
"name": "typeDoc",
"in": "path",
"description": "type of document",
"required": true,
"type": "string"
},
{
"name": "file",
"in": "path",
"description": "name of the file",
"required": true,
"type": "string"
}
],
"responses": {
"200":{
"description": "Report generated succefully. ",
"content":{
"application/octet-stream":{
"schema":{
"type": "string",
"format": "binary"}
}
}
},
"500": {
"description": …Run Code Online (Sandbox Code Playgroud) 我正在开发一个有角度的项目,我的问题是,当我点击 div 时,我打开一个新选项卡,但它对我不起作用。它工作了<a>. 有人能帮我吗 ?这是我的代码:
<div class="application" target="_blank" routerLink="/home">
<img class="imgChart " src="./../assets/img/charts.jpg" alt="image 1">
<div class="title-app">{{'STORE.APPSTAT' | translate}}</div>
<p>{{'STORE.DESCRIPTIONSTATISTIQUE' | translate}}</p>
</div>
Run Code Online (Sandbox Code Playgroud) 我正在开发一个带角度材料的角度2应用程序.我有两个按钮登录并注册我想要两个按钮之间的垂直线; 我在不同的网站上看到了很多例子,但它不起作用.我希望按钮在同一条线上(内联,并在它们之间有一条小垂直线).这是html代码:
.textAlign {
text-align: center;
color: white;
position: absolute;
top: 50%;
left: 50%;
/* à 50%/50% du parent référent */
transform: translate(-50%, -50%);
font-family: 'Source Sans Pro';
}
h1 {
font-weight: bold;
}
.image {
width: 100%;
}
.ligne_verticale {
width: 5px;
border-left: 5px solid gray;
height: 70px;
}
.nav-button {
text-align: center;
vertical-align: middle;
border: solid 1px;
border-radius: 5px;
background-color: white;
font-weight: bold;
width: 120px;
margin-right: 10%;
}Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div class="content">
<div>
<img class="image" src="http://seabramota.com/img/intro-bg.jpg" alt="image
d'accueil"> …Run Code Online (Sandbox Code Playgroud)我正在开发一个有角度的项目。我有一个表文件,我想将每个元素与一个数据值进行比较(如果正确),我会做声明,否则我会做另一个比较,但是我的问题是,即使数据正确,它也总是会获取所有表,并且应该在其他很短的时间。请如何避免这种情况。
这是我的代码:
if (this.data) {
this.imgNotFoundText = '';
this.data.package.files.forEach(element => {
i++;
this.picture = '';
if (element.name == this.data.properties.Name) {
this.picture = 'picOne.png'
}
if (i == this.data.package.files.length && this.picture == '') {
this.picture = './../assets/img/notFound.jpg'
}
});
}
Run Code Online (Sandbox Code Playgroud)