小编Sus*_*vam的帖子

迭代Typescript中的对象数组

我需要以角度2迭代对象数组,并限制对象中特定键的字符串长度显示.

 this.productService.loadAllProducts(product).subscribe(data => {
  if (this.authService.checkActiveSession(data)) {
    if (data.success) {
     //console.log(this.product_desc.substring(0,2))
         for(let i=0;i<data.products.length ;i++){  //How to properly iterate here!!
         console.log(data.products[0].product_desc)
      }
      this.source.load(data.products);
     } else {
      console.log('Not binded');
    }
  }
Run Code Online (Sandbox Code Playgroud)

}); }

我需要将prod_desc长度限制为(例如)10个字符,同时替换我使用过的:

例如:

this.product_desc.substring(0,10)
Run Code Online (Sandbox Code Playgroud)

javascript typescript angular

37
推荐指数
2
解决办法
8万
查看次数

Git 如何使用 SSH 密钥、用户名进行克隆

我有以下内容,我需要在 Windows 终端命令提示符或 linux 中克隆存储库。

  • 网址: git@xxxxx.com:xxx/xxx/git
  • 用户名: xxx@xxx.in
  • SSH 密钥: ssh-rsa AAAAB3NzaC1yxxxxxxxxxxxx....xxx@xxx.in

我试过:

git clone git@xxxxx.com:xxx/xxx/git
Run Code Online (Sandbox Code Playgroud)

我得到

Permission denied(public key)
Couldn't read from remote repository
Run Code Online (Sandbox Code Playgroud)

还尝试将 URL 更改为:

git clone https://xxxxx.com:xxx/xxx/git
Run Code Online (Sandbox Code Playgroud)

git clone

35
推荐指数
3
解决办法
6万
查看次数

无法在hybris中创建类别

如何在类别插入期间克服Hybris中的此错误

我收到此错误:

在此输入图像描述

hybris

0
推荐指数
1
解决办法
566
查看次数

array_values()期望参数1为数组,给定为null

在array_values()函数中有什么不对.

我尝试将$ updated_f分配给array().

我得到警告:array_values()期望参数1是数组,给定null

$this_params = array_merge_recursive($params, array('f' => array($filter['prefix'] => array($item['id'])))); 

if (isset($this_params['f'])) {
    $updated_f = array(); 
   //Updated code
    if(isset($this_params['f']) && is_array($this_params['f']) && count($this_params['f']) >0)
    {
      foreach($this_params['f'] as $f_key => $assoc_array) {
         $updated_f[$f_key] = array_values($assoc_array);   //Warning here
       } 
    }
    $this_params['f'] = $updated_f;
  }
Run Code Online (Sandbox Code Playgroud)

php arrays

-1
推荐指数
1
解决办法
6261
查看次数

标签 统计

angular ×1

arrays ×1

clone ×1

git ×1

hybris ×1

javascript ×1

php ×1

typescript ×1