我正在使用Ubuntu 16.04,我想用快捷方式在当前文件夹中打开终端(而不是通过右键单击并在此处打开终端)。例如,通过按f4或其他不同的键,它将打开我所在的终端(可能位于/ home / user / someDirectory)。我进行了很多研究,但找不到,是否有示例脚本或选项可用于去做 ?
谢谢。
大家好,我正在尝试将所有评论放在数组中以在 *ngFor 上显示,但在订阅数据时出现 json 对象,因此无法连接。
这是我的代码
TS
this.http.post('http://' + this.ipAdress + ':3100/api/infitineComments/:id', { "page": this.page })
.map(res => res.json())
.subscribe(data => {
if (...) { //error part
}
else {
let d = [];
for(let i = 0; i< data.length; i++){
d.push(data[i])
}//I did this part because data was object in array type , also
//doesnt work
this.comments = this.comments.concat(d);
console.log("data: ", this.comments);
}
}, err => {
console.log("err: ", err);
});
Run Code Online (Sandbox Code Playgroud)
这是我的错误的小图片,所有列表都包括 id、comment、userId...

谢谢
我有一个包含2个数组的对象数据(照片和注释来自服务器),我想用* ngFor显示它们,但是ngFor仅显示数组类型。
这是我的Ts文件:
this.comments=[];
// ...
.subscribe((data) => {
this.comments= data.comments;
console.log("data: ", data);
this.commentPhoto = data.Photo;
// I don't want to create another array
// I want to make commentPhoto and comments array in 1 Array to show them.
Run Code Online (Sandbox Code Playgroud)
HMTL
<ion-row *ngFor="let cm of comments">
<ion-col col-2 style="border:1px solid grey;">
<img src="{{cm.photo}}" style="width:45px;height:45px;">
</ion-col>
<ion-col col-10 style="border:1px solid grey;">
{{cm}}
</ion-col>
</ion-row>
Run Code Online (Sandbox Code Playgroud)