小编Dev*_*ool的帖子

Sequelize 查找 currentUserEditor 不为 null 的所有内容

我如何从 currentUserEditor !== null 的表中找到所有内容?

我需要检查 currentUserEditor 是否为空,以及是否为空,其他用户可以编辑内容,但如果有一个用户不为空,其他用户可以编辑。

node.js sequelize.js

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

我如何检测div何时跨越cdk拖放角度材料上的另一个div元素

我在我的项目中使用角度材质 cdk 拖放,首先动态创建元素,然后将其拖放到屏幕上的任何位置。

当我创建 2 个 div 并将 div 拖到 div 上时,有没有办法知道 div 何时掉落到其他 div 上?

我希望当 div 位于 div 内部时将附加 div 着色为其他颜色。

谢谢

javascript angular-material angular angular-cdk-drag-drop

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

Angular 有一个签名板可以将其保存为图像吗?

我需要制作一个签名板并保存它。我在企业网站上工作,我需要为每个用户保存签名。什么是最好的包装?

angular

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

Angular无法分配给对象“[object HTMLImageElement]”的只读属性“offsetTop”

我尝试更改 dom 中元素的位置,但收到此错误。我使用 elementRef。

网页:

<div class="container">
  <div class="original-pdf">
    <pdf-viewer *ngIf="pdfSrc" [(page)]="pageVariable" [show-all]="true" [render-text]="true" [original-size]="true"
      [src]="pdfSrc">
     </pdf-viewer>
     <img #Signature *ngIf="imageExpress" class="signature-image" [src]="imageExpress | safeHtml" cdkDragBoundary=".original-pdf"
     (cdkDragEnded)="onDragEnded($event)" cdkDrag>
  </div>
</div> 
Run Code Online (Sandbox Code Playgroud)

TS:

import { Component, AfterViewInit, ViewChild, ElementRef } from '@angular/core';
@ViewChild('Signature', {static: false }) Signature: ElementRef;

ngAfterViewInit() {
    this.openPdf();
    this.openImage();
    setTimeout(() =>{
      console.log(this.Signature.nativeElement.offsetTop);
      this.Signature.nativeElement.offsetTop = 0;
    }, 1000);
  }
Run Code Online (Sandbox Code Playgroud)

angular

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

NgRx 减速器中的拼接索引不会删除一个索引

我尝试使用 NgRx v8 和动作调度删除数组中的一个索引,但它删除了除数组中的第一项之外的所有数组。

我尝试从我的数组中删除 1 个项目,但它不起作用。

Reducer:
import { Comment } from '../models/comment.model';
import * as CommentAction from '../actions/comment.actions';
import { Action, createReducer, on } from '@ngrx/store';

export const initialState: Comment[] = [];

const commentReducer = createReducer(
  initialState,
  on(CommentAction.addcomment, (state, { fullName, comment }) => [...state, { fullName, comment }]),
  on(CommentAction.removecomment, (state, { index }) => state.splice(index, 1))
);

export function reducer(state: Comment[], action: Action) {
  return commentReducer(state, action);
}
Run Code Online (Sandbox Code Playgroud)

行动

import { createAction, props } from '@ngrx/store';
import …
Run Code Online (Sandbox Code Playgroud)

ngrx angular

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