当前,用户只能使用“材料” create和“ done图标”作为步骤标题。这些更改提供了通过提供ng-template覆盖来自定义图标的功能。所以我找到了更新,
但是当我将其用作
<mat-horizontal-stepper [linear]="isLinear">
<mat-step [stepControl]="firstFormGroup">
<form [formGroup]="firstFormGroup">
<ng-template matStepLabel>Fill out your name</ng-template>
<ng-template matStepperIcon="edit">
<custom-icon>edit</custom-icon>
</ng-template>
<mat-form-field>
<input matInput placeholder="Last name, First name" formControlName="firstCtrl" required>
</mat-form-field>
<div>
<button mat-button matStepperNext>Next</button>
</div>
</form>
</mat-step>
<mat-step>
<ng-template matStepLabel>Done</ng-template>
You are now done.
<div>
<button mat-button matStepperPrevious>Back</button>
</div>
</mat-step>
</mat-horizontal-stepper>
Run Code Online (Sandbox Code Playgroud)
我得到这个错误
Uncaught Error: Template parse errors:
'custom-icon' is not a known element:
1. If 'custom-icon' is an Angular component, then verify that it is part …Run Code Online (Sandbox Code Playgroud) 所以我想检查字符串的第一个字符是否为"!".这很好用,但如果我把它作为一个条件,它每次都是错的.看看我的例子:
next.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
EditText num = (EditText) findViewById(R.id.number);
String text = num.getText().toString();
int len = text.length();
String help = text;
String first = String.valueOf(help.charAt(0));
if (len == 7 && first == "!") {
int value = text;
//...
} else {
int value2 = text;
}
}
});
Run Code Online (Sandbox Code Playgroud)
谢谢...
我想在css类上设置一个随机的背景颜色......我已经得到了这个PHP代码:
<?php $color = sprintf(“#%06x”,rand(0,16777215)); ?>
Run Code Online (Sandbox Code Playgroud)
这是我的style.php:
<?php
header('Content-Type: text/css');
?>
body {
background: INSERT PHP COLOR HERE - BUT HOW?;
}
Run Code Online (Sandbox Code Playgroud) 我有一个css/html菜单,现在我想在每次按钮被用户盘旋时执行这个PHP脚本:
CSS:
background: <?php printf( "#%06X\n", mt_rand( 0, 0xFFFFFF )); ?>;
Run Code Online (Sandbox Code Playgroud)
这是我的CSS.当我重新加载页面时,它被正确调用,但即使我将鼠标悬停在按钮上,颜色也保持不变......我该怎么改变它?
非常感谢!