小编Bra*_*ler的帖子

Angular NullInjectorError:没有 MatDialog 提供程序

因此,当我尝试加载我的 angular 应用程序时,出现此错误:

ERROR Error: Uncaught (in promise): 
NullInjectorError: StaticInjectorError(AppModule)[AppComponent -> MatDialog]:    
StaticInjectorError(Platform: core)[AppComponent -> MatDialog]:
Run Code Online (Sandbox Code Playgroud)

我的 ts 文件看起来像这样,每个其他帮助问题都说要将 MatDialog 添加到我的 NgModule 导入中,但我已经这样做了并且仍然收到错误。大多数这些错误是 StaticInjectorErrors 而我的是 NullInjectorError 但我不确定这两者之间有什么区别。

ERROR Error: Uncaught (in promise): 
NullInjectorError: StaticInjectorError(AppModule)[AppComponent -> MatDialog]:    
StaticInjectorError(Platform: core)[AppComponent -> MatDialog]:
Run Code Online (Sandbox Code Playgroud)

angular-material angular

11
推荐指数
2
解决办法
7532
查看次数

如何使用无服务器框架通过 AWS Lambda 函数环境变量访问 SSM 参数存储值?

所以我配置了 lambda 函数的 .yaml 文件,如下所示:

AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: An AWS Serverless Specification template describing your function.
Resources:
  NewUser:
    Type: 'AWS::Serverless::Function'
    Properties:
      Handler: NewUser/index.handler
      Runtime: nodejs8.10
      Environment:
        Variables:
          database_encrypt: ${ssm:databaseEncrypt}
          database_password: ${ssm:databasePassword}
          database_server: '8.8.8.8'
          database_user: ${ssm:databaseUser}
          database_version: ${ssm:databaseVersion}
      Description: ''
      MemorySize: 128
      Timeout: 15
      Role: 'arn:aws:iam::663404525923:role/LambdaRole'
      Events:
        LambdaMicroservice:
          Type: Api
          Properties:
            Path: /User/NewUser
            Method: ANY
Run Code Online (Sandbox Code Playgroud)

我的 lambda 函数如下所示:

var config = {  
  user: process.env.database_user,  
  password: process.env.database_password,  
  server: process.env.database_server,
  database: process.env.database_version,
  options: {encrypt: true}  
};

class UserService {

    constructor(){
        console.log(config); …
Run Code Online (Sandbox Code Playgroud)

amazon-web-services node.js aws-lambda serverless-framework aws-parameter-store

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

包管理器控制台挂在 npm init 上

所以我试图在 NuGet 中运行一个基本的 npm 安装,当我运行“npm init”时,它在运行到这里后立即挂起:

This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help json` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
Run Code Online (Sandbox Code Playgroud)

此时它不会响应任何命令,^C 也不做任何事情。

我试过重新安装 npm,更新 npm,关闭并重新打开 Visual Studio 2019,没有骰子。我能找到的所有帮助都说这是几年前的问题,但修复方法要么是恢复最近的 npm 更新,要么只是等待新版本发布,所以我不确定为什么我会看到它在 …

npm nuget nuget-package npm-init visual-studio-2019

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