我如何从 currentUserEditor !== null 的表中找到所有内容?
我需要检查 currentUserEditor 是否为空,以及是否为空,其他用户可以编辑内容,但如果有一个用户不为空,其他用户可以编辑。
我在我的项目中使用角度材质 cdk 拖放,首先动态创建元素,然后将其拖放到屏幕上的任何位置。
当我创建 2 个 div 并将 div 拖到 div 上时,有没有办法知道 div 何时掉落到其他 div 上?
我希望当 div 位于 div 内部时将附加 div 着色为其他颜色。
谢谢
我需要制作一个签名板并保存它。我在企业网站上工作,我需要为每个用户保存签名。什么是最好的包装?
我尝试更改 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) 我尝试使用 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)