请有人为我澄清为什么:
from numpy import cumsum
from numpy.random import geometric
for index in cumsum(geometric(p, size=int(len(ary) * p * 1.1))):
if index < len(ary):
ary[index] = # compute new value
其中“ InputGroup”界面为:
import { Component, OnInit } from '@angular/core';
import { InputGroup } from "../input-group";
@Component({
selector: 'app-input-group',
template: `<ul>
<li *ngFor="let input of inputs;">
<div innerHtml={{input.name}}></div>{{ input.name }},{{input.check}}
</li>
</ul>
`,
// template: '<div ng-bind-html="inputs"></div>'
})
export class InputGroupComponent implements OnInit {
public Create_Element(type: string, name: string): HTMLInputElement {
var element = document.createElement("input");
element.setAttribute("type", type);
element.setAttribute("name", name);
return element;
}
public inputs: InputGroup[] = [
{
name: this.Create_Element("text", "food1"),
check: this.Create_Element("checkbox", "food1Check")
},
{
name: this.Create_Element("text", "food2"),
check: this.Create_Element("checkbox", "food2Check")
},
{
name: this.Create_Element("text", "food3"),
check: this.Create_Element("checkbox", "food3Check")
},
];
constructor() { }
ngOnInit() {
}
}
显示以下内容:
export interface InputGroup {
name: HTMLInputElement,
check: HTMLInputElement
}
作为我的全部输出。
要澄清:
我正在尝试创建3组具有文本/复选框输入的输入,但我却获得了[object object]。