小编MRe*_*ati的帖子

无法在 app.module 中导入 MatDialogModule

我是角度的初学者,我正在使用角度材质对话框。首先,我将材料添加到我的项目中并从@angular/material.

当我在中添加 ( import { MatDialogModule } from '@angular/material/dialog';)) 时app.module.ts,在编译项目时出现以下错误

 ERROR in node_modules/@angular/cdk/coercion/array.d.ts(10,60): error
 TS1005: ',' expected.
 node_modules/@angular/cdk/coercion/array.d.ts(10,61): error TS1005:
 ',' expected. node_modules/@angular/cdk/coercion/array.d.ts(10,75):
 error TS1144: '{' or ';' expected.
 node_modules/@angular/cdk/coercion/array.d.ts(10,77): error TS1011: An
 element access expression should take an argument.
Run Code Online (Sandbox Code Playgroud)

为什么?

这是我的 package.json:

      {
      "name": "sales-maret",
      "version": "0.0.0",
      "scripts": {
        "ng": "ng",
        "start": "ng serve",
        "build": "ng build",
        "test": "ng test",
        "lint": "ng lint",
        "e2e": "ng e2e"
      },
      "private": true,
      "dependencies": {
        "@angular/animations": "^7.2.16",
        "@angular/cdk": …
Run Code Online (Sandbox Code Playgroud)

dialog angular-material angular-cli angular angular9

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

单位测试属性的主体

这是我的代码

public class AssistanceRequest : DocumentBase
{
    public AssistanceRequest()
    {
        RequestTime = DateTime.Now;
        ExcecutionTime = DateTime.MaxValue;
    }

    public AssistanceRequest(int amount, string description, DateTime? requestTime) : this()
    {
        //Check for basic validations
        if (amount <= 0)
            throw new Exception("Amount is not Valid");
        this.Amount = amount;
        this.Description = description;
        this.RequestTime = requestTime ?? DateTime.Now;
    }

    private long Amount { get; set; }

    private DateTime requestTime { get; set; }

    public DateTime RequestTime
    {
        get { return requestTime; }
        set
        {
            if (value …
Run Code Online (Sandbox Code Playgroud)

c# theory asp.net-mvc unit-testing xunit

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