草庐IT

angular-jwt

全部标签

在Angular 2打字稿中使用Flow.js(续)

这个问题与这个问题有关:在Angular2打字稿中使用Flow.js.有人在实施方面取得成功吗flow.js?其中一条评论说要遵循“Angular-Cli方式”,但我仍然无法正常工作。有人可以提出细节解释吗?看答案您可以将其添加到index.html中并使用这个打字稿声明。

无法在Angular 4项目中添加材料设计

在正式教程之后,我尝试将材料设计添加到我的项目中(https://material.angular.io/guide/getting-started)但是我有一个错误:node_modules/@angular/cdk/typings/rxjs/rxjs/rx--operators.d.ts(11,10):错误ts2305:module'“path_to_project/node_modules/rxjs/schedules”''没有导出的成员'iScheduler'。node_modules/@angular/platform-b​​rowser/animations/src/provide

javascript - 将 JWT token 传递给 SockJS

我需要在与SockJS握手时发送token。我已经尝试了许多建议的实现,但调用了相同的异常java.lang.IllegalArgumentException:JWTStringargumentcannotbenullorempty.在后端WebSocketConfig@Configuration@EnableWebSocketMessageBroker@CrossOriginpublicclassWebSocketConfigimplementsWebSocketMessageBrokerConfigurer{@OverridepublicvoidconfigureMessageBr

java - 如何使用angular js spring mvc上传多部分文件

我正在尝试使用angularjs和springMVC上传文件我在application-context.xml中有一个multipartResolverbean。我的表格是这样的:QuoteIdentifier:ChoosePleaseuploadthefile:*ValidFileInvalidFileContinue$scope.continueFileUpload=function(){varuploadUrl=serverUrl+"continueFileUpload";varformData=newFormData();formData.append("file",file.

Angular 4:观察控制器变量

假设我有一个旧的代码,我不想更改。我有三个服务器通话,以获取一些数据,在所有这三种方法成功之后,我必须运行一些代码。我添加了变量,我想收听其更改(ngonchanges不起作用)。这是代码:ngOnInit(){this.loadedReq=0;//Whenthisvaris3-thenallrequestspassed,andihavetorunsomecustomcode,howtowatchonthisvariable?this.getCars();this.getModels();this.getTypes();}getCars(){returnthis.myService.getCa

Angular 17+ 高级教程 – Component 组件 の ng-template

前言上一篇 DynamicComponent 我们有提到,作为MVVM框架的Angular需要有方法替代掉2个DOMManipulation:document.createElement template.content.cloneDynamicComponent便是替代document.createElement的方案。而这篇我们要讲的ng-template则是template.content.clone的替代方案。 ng-templateの简单使用我们从浅入深,一个一个特性介绍,最后才逛源码,看看原理机制。提醒:为了更容易体会到细节,我把ngZone关了,所有组件都设置成ChangeDet

java - 带有 JWT 的 Spring OAuth2 - 分离 Auth 和资源服务器时无法将访问 token 转换为 JSON

我希望使用SpringBoot创建一个OAuth2身份验证服务器,它可以被多个资源服务器使用。因此,我需要将这两个服务器创建为独立的应用程序。我的主要引用文献是thisarticle还有这个StackOverflowquestion.引用文章将两种服务器类型组合到一个应用程序中。我很难将它们分开。我可以使用以下方法检索token:curltestjwtclientid:XY7kmzoNzl100@localhost:8080/oauth/token-dgrant_type=password-dusername=john.doe-dpassword=jwtpass这个调用返回:{"acc

在 Angular 中使用 Renderer2

Renderer2类Renderer2类是Angular提供的一个抽象服务,允许在不直接操作DOM的情况下操纵应用程序的元素。这是推荐的方法,因为它使得更容易开发可以在没有DOM访问权限的环境中渲染的应用程序,比如在服务器上、在WebWorker中或在原生移动端。基本用法通常会在自定义指令中经常使用Renderer2,因为Angular指令是修改元素的逻辑构建块。以下是一个简单的示例,使用Renderer2的addClass方法向具有该指令的元素添加wild类:import{Directive,Renderer2,ElementRef,OnInit}from'@angular/core';@D

在Angular4应用程序中显示模式对话框的数据

我有一个Angular4应用程序,我想在对话框中显示数据。所以,我用@Output将数据传递到子女组件。因此,在父组件中,我有:exportclassDashboardComponent{myTask;publicreturnTask(task:any):void{console.log("returnTask");this.myTask=task;console.log(this.myTask);}openDialogEditTask(){console.log(this.myTask);letdialogRef=this.dialogEditTask.open(DialogEditTask

Angular模块 - 遇到错误的错误在统计上解析符号值

我创建了以下模块,遵循此内容指导:@NgModule({//...})exportclassMatchMediaModule{privatestaticforRootHasAlreadyBeenCalled:boolean=false;//Themethodisusedforprovidingthe//featuremodule'sprovidersonlyONCEstaticforRoot():ModuleWithProviders{if(this.forRootHasAlreadyBeenCalled){thrownewError('ModuleWithProviders-forRoot(