我想知道是否有一种方法可以在 vim 中使用 Windows 快捷方式(特别是那些用于选择行的快捷方式(使用 shift、alt、ctrl)?也许可以在 .vimrc 中设置一个选项?
谢谢。
的data-trigger焦点不是为我工作...
<span data-content='foo' data-html='true' data-placement='top' data-container='body' data-trigger='focus' bs-popover>
Run Code Online (Sandbox Code Playgroud)
点击这个元素时,实际上什么也没发生.如果我删除data-trigger='focus'并将其设置为hover或click,它确实有效.
我正在使用angularjs.1.2.18和角带:2.2.4
在我的主要html文件中,我定义了以下内容,希望将其用作项目全局变量:
<script type="text/javascript" charset="utf-8">var path='/';
path=path.substr(0, path.length - 1);
</script>
Run Code Online (Sandbox Code Playgroud)
然后,我在几个不同的ts文件中使用变量路径,并且工作正常。但是,我确实收到一条编译警告,提示未定义路径。如何防止此警告发生?
嘿,我尝试过以下代码:
constructor(private _route: ActivatedRoute) {}
ngOnInit() {
this._route.params.toPromise().then(data => {
...
})
}
Run Code Online (Sandbox Code Playgroud)
然而,它没有做任何事情.如果我换toPromise().then用subscribe它工作正常.知道为什么它不起作用吗?我已经toPromise().then在我的项目中的许多其他地方使用过,它工作得很好.
我在 Linux 环境中,我想了解如何指定 Chromium 应该使用的路径。目前,这是我遇到的错误:
Chromium revision is not downloaded. Run "npm install" or "yarn
install" Error: Chromium revision is not downloaded. Run "npm
install" or "yarn install" at Launcher.launch
Run Code Online (Sandbox Code Playgroud)
我确实通过使用变量故意禁用了下载PUPPETEER_SKIP_CHROMIUM_DOWNLOAD,但是我还没有找到如何提供我的 chromium 二进制文件的路径。
我确实有一个div,overflow-y: auto; height: 300px;如果其中的文本很大,我希望在其中显示滚动条()。但是,我的div已经包含该属性height:auto;(出于某种垂直对齐的目的)。无论如何,我可以保留height:auto并在必要时仍显示滚动条吗?
HTML:
<div class = 'valign scrollbar'>
My Text
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
.valign {
height: auto;
}
.scrollbar {
height: 300px;
overflow-y: auto;
}
Run Code Online (Sandbox Code Playgroud) 我想知道打字稿是否提供了避免臭名昭着的方法:
let that = this
Run Code Online (Sandbox Code Playgroud)
例如,我有一个类调用我正在订阅的web api,并且在订阅中引用了我的类,我确实为它创建了一个变量this.
class Foo {
f = {}
let that = this
this.http.get(foo)
.subscribe {
res => that.f = res
}
}
Run Code Online (Sandbox Code Playgroud) 我在Angular2中定义了一个指令,我希望它可以在所有组件中使用,而不必directives: [MyDir]在每个组件中执行:
我想应该有一种方法,*ngIf因为实例随处可见.
嘿,我正在尝试测试以下课程:
class Foo {
def f: Int = 4 + g
def g: Int = 2
}
Run Code Online (Sandbox Code Playgroud)
我的测试如下:
class FooSpec extends PlaySpec with MockFactory {
val foo = new Foo()
"Foo" must {
"Call function f" in {
(foo.g _)
.expects()
.once()
.returns(5)
foo.f must be (9)
}
}
}
Run Code Online (Sandbox Code Playgroud)
我的测试失败说:
java.lang.NoSuchMethodException: Foo.mock$g$0()
java.lang.Class.getMethod(Unknown Source)
...
Run Code Online (Sandbox Code Playgroud)
我不确定为什么...
我正在使用 scalatest 和 scalamock :
"org.scalatestplus.play" %% "scalatestplus-play" % "1.5.0" % "test"
"org.scalamock" %% "scalamock-scalatest-support" % "3.2.2" % "test"
Run Code Online (Sandbox Code Playgroud) 我正在摆弄键入的 FormGroup。
我创建了以下内容:
export interface CustomFormControls {
name: FormControl<string|null>
content: FormControl<string|null>
}
export class CustomForm extends FormGroup<CustomFormControls> {
constructor() {
super({
name: new FormControl('name'),
content: new FormControl('content'),
})
}
}
Run Code Online (Sandbox Code Playgroud)
然后我尝试在组件中使用它:
form: CustomForm = new CustomForm()
Run Code Online (Sandbox Code Playgroud)
在我的模板中:
<form class="Form" [formGroup]="form">
Run Code Online (Sandbox Code Playgroud)
但是,我收到以下错误:
Type 'CustomForm' is not assignable to type 'FormGroup<any>'.
Types of property 'controls' are incompatible.
Type 'CustomFormControls' is not assignable to type '{ [key: string]: AbstractControl<any, any>; }'.
Index signature for type 'string' is missing in type 'CustomFormControls'.
<form class="Form" …Run Code Online (Sandbox Code Playgroud)