小编Raj*_*ana的帖子

angular 4 - i want to create clone of the dom element

i want to create a clone of the dom element for eg:-

<div>
  <p></p>
  <p></p>
  <p></p>
  <p></p> 
<button (click)="copy()"></button>
</div>
Run Code Online (Sandbox Code Playgroud)

here when i click on the button the whole div element should be cloned below it

if you click 10 times 10 clone should appear also the orignal dom element should appear

i have tried with the ng-template ,elementrefrence ,render2 ,Viewchild

typescript angular

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

角度:我想在元素加载时调用一个函数

我想在加载元素时调用带有参数的函数。就像angualrjs中的nginit一样。我们可以在Angular 4中做到吗?

<div *ngFor="let item of questionnairelist"  (onload)="doSomething(item.id)" ></div>
Run Code Online (Sandbox Code Playgroud)

我的打字稿功能:

doSomething(id) {
    console.log(id);
}
Run Code Online (Sandbox Code Playgroud)

typescript angular

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

使用 httponly cookie 在 nextjs 中进行登录和身份验证

您好,我正在使用 nextjs 构建一个应用程序,我正在从客户端调用登录 API,我得到一个想要发送到 nextjs 服务器的令牌,并设置该身份验证令牌的 httponly cookie,这样客户端脚本就无法访问该令牌注销时的令牌我想销毁该 cookie

我的问题是如何实际实现这一目标

或者您对使用 React 和 nextjs 进行登录和授权有任何其他建议吗

reactjs next.js

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

标签 统计

angular ×2

typescript ×2

next.js ×1

reactjs ×1