小编Vin*_*rma的帖子

'+' 字符在 HttpParams angular 6 中转换为空格

我有一个 JSON 对象并使用 HttpParams 传递它,但它转换 + 到空间并发送到后端。我已经尝试了所有可能的方法,但没有人为 JSONObject 字符串解决了这个问题。

this.updateUser({"name":"ABC","mobile": "+911234567890","text":"1 + 2 = 3"});

public updateUser(myObj) {

    const body = new HttpParams().set('user_object', JSON.stringify(myObj));
    return this.http.post(url, body, {
      headers: new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded;charset=utf-8')
    });
  }
Run Code Online (Sandbox Code Playgroud)

当我在 Network 中检查时,包含 + 字符的对象会自动转换为空格。

encoding json typescript angular

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

HQL - 将多行中的列值连接到具有重复 id 的单列中

我想将重复的 id 连接到单行。

 user.id | group.name        
    1    |     a
    1    |     b
    1    |     c
Run Code Online (Sandbox Code Playgroud)

我想要这样的:-

user.id | group.name        
   1    |   a,b,c
Run Code Online (Sandbox Code Playgroud)

我想要的一切都在 hql 中。如何在用户离开加入组的 hql 查询中写入。需要帮忙!!!

hibernate hql

5
推荐指数
0
解决办法
1250
查看次数

如何在 angular 5 中覆盖 ngbPopover 的 CSS?

我正在使用 ng-bootstrap 并想为弹出框内容添加自定义 CSS。我正在尝试在 app.component.css 中应用,但它没有在 popover-body 中应用。

检查这个!! 我想在这个属性中应用 CSS

angular-cli angular

2
推荐指数
1
解决办法
6445
查看次数

标签 统计

angular ×2

angular-cli ×1

encoding ×1

hibernate ×1

hql ×1

json ×1

typescript ×1