我正在尝试使用角度flex-layout,但我对指令fxFlex有问题,特别是参数flex-grow.
医生说:
flex-grow:定义一个flexbox项目应该增长多少(与其他项目成比例),如果有空间可用的话.flex-grow值会覆盖宽度.
所以我认为使用下面的代码,第二个div应该是第二个代码的两倍,应该填充空白空间:
<div fxLayout="row">
<div fxFlex="2 1 30%">[flex="2 1 30%"]</div>
<div fxFlex="1 1 40%">[flex="1 1 40%"]</div>
</div>
Run Code Online (Sandbox Code Playgroud)
但它不能像我预期的那样工作,我无法找出flex-grow使用该参数的条件是什么?
这是我合作过的那个人.
我开发了一个Spring Boot / Angular JS应用程序。现在,我正在尝试实现一些GUI界面测试。
我尝试使用Selenium ChromeDriver,因此添加了Selenium依赖项:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.4.0</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
我创建了第一个测试:
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = MyMainClass.class)
public class SeleniumTest {
private WebDriver driver;
@Before
public void setup() {
System.setProperty("webdriver.chrome.driver", "my/path/to/chomedriver");
driver = new ChromeDriver();
}
@Test
public void testTest() throws Exception {
driver.get("https://www.google.com/");
}
}
Run Code Online (Sandbox Code Playgroud)
这很好。但是现在我想让我的应用页面具有:
driver.get("http://localhost:8080/");
Run Code Online (Sandbox Code Playgroud)
但是我在Chrome浏览器中看到了“ ERR_CONNECTION_REFUSED”。
我认为这是因为我需要先设置测试才能运行Web应用程序,然后才能运行测试,但是我找不到实现该目标的方法?
这令人沮丧,我试图在我的内部加载一个简单的脚本,index.html但我得到了 404。
索引.html
<head>
<meta charset="utf-8">
<title>Login</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root></app-root>
<script type="text/javascript" src="./app/scripts/angular-cookies.js"></script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
这是我的项目结构
这是我得到的错误 - 404
该文件在那里,它不是空的。我也试过:
<script type="text/javascript" src="../app/scripts/angular-cookies.js">
Run Code Online (Sandbox Code Playgroud)
和
<script type="text/javascript" src="app/scripts/angular-cookies.js">
Run Code Online (Sandbox Code Playgroud)
和
<script type="text/javascript" src="/app/scripts/angular-cookies.js">
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激,谢谢!
我想在primeng下拉列表中获取之前选择的值.
<p-dropdown [options]="options" [filter]="true" [(ngModel)]="selectedType" (onChange)="onSelectType($event)" formControlName="alertType"></p-dropdown>
Run Code Online (Sandbox Code Playgroud)
在更改事件时,我想使用api检查所选类型是否有效,但是如果它无效则需要还原.由于我使用的是ngModel,因此只要下拉列值发生更改,selectedType的值就会发生变化.
那么我怎样才能获得之前选择的值?
我正在尝试使用角度形式的角度材料2 datepicker,我收到此错误:
vendor.bundle.js:92803 ERROR TypeError: Cannot read property 'invalid' of undefined
at MdInput.defaultErrorStateMatcher [as errorStateMatcher] (vendor.bundle.js:121344)
at MdInput.webpackJsonp.../../../material/@angular/material.es5.js.MdInput._updateErrorState (vendor.bundle.js:131778)
at MdInput.webpackJsonp.../../../material/@angular/material.es5.js.MdInput.ngDoCheck (vendor.bundle.js:131739)
at checkAndUpdateDirectiveInline (vendor.bundle.js:102634)
at checkAndUpdateNodeInline (vendor.bundle.js:104132)
at checkAndUpdateNode (vendor.bundle.js:104071)
at prodCheckAndUpdateNode (vendor.bundle.js:104765)
at Object.View_FormComponent_0._co [as updateDirectives] (ng:///AppModule/FormComponent.ngfactory.js:2337)
at Object.updateDirectives (vendor.bundle.js:104522)
at checkAndUpdateView (vendor.bundle.js:104038)
Run Code Online (Sandbox Code Playgroud)
以下是我的组件的代码形式:
import {Component, OnInit, Output, Input, EventEmitter} from "@angular/core";
import {FormControl, Validators, FormGroup} from "@angular/forms";
import {ReferentialService} from "../shared/referential.service";
@Component({
selector: 'app-form',
templateUrl: './form.component.html',
styleUrls: ['./form.component.css']
})
export class FormComponent implements OnInit {
private form: …Run Code Online (Sandbox Code Playgroud) angular ×4
javascript ×2
angularjs ×1
css3 ×1
dropdown ×1
flexbox ×1
gui-testing ×1
html ×1
node.js ×1
primeng ×1
select ×1
selenium ×1
spring ×1
spring-boot ×1