小编Ten*_*nho的帖子

更改 ngx 分页 CSS

如何更改ngx-paginationCSS?我尝试过:

:host /deep/ .ngx-pagination {
  padding-left: 0px;
}

:host /deep/.ngx-pagination .current,
.btn-info {
  background: #17a2b8 !important;
  border: transparent;
  border-radius: 20px;
}

:host /deep/.ngx-pagination .current:hover {
  background: #17a2b8 !important;
  border-radius: 20px;
  border: transparent;
}
Run Code Online (Sandbox Code Playgroud)

在组件 .css 内部,但没有任何变化,我收到此警告

[弃用] CSS 动态配置文件中不再支持 /deep/ 组合器。它现在实际上是无操作的,就像一个后代组合器一样。/deep/组合器将被移除,并且在M65处无效。你应该删除它。有关更多详细信息,请参阅https://www.chromestatus.com/features/4964279606312960 。

我该如何解决这个问题?感谢您的时间!

编辑:

.html

  <div class="clearfix">
    <pagination-controls (pageChange)="p = $event"></pagination-controls>
  </div>
Run Code Online (Sandbox Code Playgroud)

.css

.clearfix {
  position: relative;
  right: 35%;
  left: 35%;
  font-size: 14px;
}
Run Code Online (Sandbox Code Playgroud)

编辑2:(渲染后的html)

<div class="clearfix">
    <pagination-controls nextlabel="Next" previouslabel="Previous" ng-reflect-previous-label="Previous"
      ng-reflect-next-label="Next">
      <pagination-template ng-reflect-max-size="7">
        <!--bindings={
    "ng-reflect-ng-if": "true" …
Run Code Online (Sandbox Code Playgroud)

html angular angular6 ngx-pagination

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

在js中比较2个对象的最快方法

在javascript中比较2个对象的最快方法是什么?

例如我有这两个对象:

a = [{'name': 'john', 'age': 22}, {'name': 'mike', 'age': 23}, {'name': 'anne', 'age': 12}, {'name': 'dan', 'age': 29}, {'name': 'jane', 'age': 34}]
b = [{'name': 'john', 'age': 22}, {'name': 'anne', 'age': 12}]
Run Code Online (Sandbox Code Playgroud)

通常,我会这样做:

for (var i = 0; i < a.length; i++) {
    for (var j = 0; j < b.length; j++) {
        console.log(a[i]) // => [{'name': 'john', 'age': 22}, {'name': 'anne', 'age': 12}]
    }
}
Run Code Online (Sandbox Code Playgroud)

这花费的时间太长了,还有其他更快的方法吗?感谢您的时间!

javascript angular angular6

5
推荐指数
3
解决办法
1万
查看次数

遍历对象并将其显示在表Angular 6中

我有一个看起来像这样的对象:

obj = {'a': [0, 0, 1, 0], 'b': [1, 0, 0, 1], 'c': [0, 0, 0, 0], 'd': [1, 1, 1, 0]}
Run Code Online (Sandbox Code Playgroud)

我想在这样的表中显示它:

No   | a | b | c | d 
0    | 0 | 1 | 0 | 1
1-3  | 0 | 0 | 0 | 1
4-6  | 1 | 0 | 0 | 1
7-9  | 0 | 1 | 0 | 0
      //a //b //c //d
Run Code Online (Sandbox Code Playgroud)

我该如何使用ngFor

这是我的html

<table>
  <thead>
    <tr> …
Run Code Online (Sandbox Code Playgroud)

html ngfor angular angular6

3
推荐指数
1
解决办法
1095
查看次数

没有管道的过滤器Angular 6:压倒性问题

我有2类过滤器:groupname。我如何修改此代码,因为它们不能作为管道工作,它们是独立的,并且name过滤器覆盖group过滤器并向后覆盖。

.ts

 changeGroup(event) {
   const group = event.target.value;
   const index = this.groupValue.indexOf(group);

   if (index > -1) {
     this.groupValue.splice(index, 1);
   } else {
     this.groupValue.push(group);
   }

   this.transform(this.usersList, 'group', this.groupValue)

   if (this.groupValue.length == 0) {
     this.transform(this.usersList, '', this.groupValue)
   }
 }

 changeUser(event) {
   const user = event.target.value;
   const index = this.userValue.indexOf(user);

   if (index > -1) {
     this.userValue.splice(index, 1);
   } else {
     this.userValue.push(user);
   }

   this.transform(this.usersList, 'name', this.userValue)

   if (this.userValue.length == 0) {
     this.transform(this.usersList, '', this.userValue)
   }
 } …
Run Code Online (Sandbox Code Playgroud)

html javascript filter angular angular6

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

单击模板Angular 6中的按钮

我有这个功能:

 windowInfo_(marker, i, data) {
      '<div style="' + this.content_ + '">' +
      '<div>' +
      '<img [src]="' + "'" + this.image + "'" + '"' + ' style="' + this.image_ + '" alt="avatar">' +
      '</div>' +
      '<div style="' + this.details_ + '">' +
      '<div>' +
      '<h5 style="' + this.company_name + '">' + data.company_name + '</h5>' +
      '<i class="fa fa-map-marker" id="' + this.country_city + '">' + data.country + ',' + data.city + '</i>' +
      '</div>' +
      '</div>' +
      '</div>' +
      '<button class="' …
Run Code Online (Sandbox Code Playgroud)

html angular angular6

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

标签 统计

angular ×5

angular6 ×5

html ×4

javascript ×2

filter ×1

ngfor ×1

ngx-pagination ×1