小编Pat*_*zlo的帖子

我应该如何在Angular 8中为@ViewChild使用新的static选项?

我应该如何配置新的Angular 8视图子级?

@ViewChild('searchText', {read: ElementRef, static: false})
public searchTextInput: ElementRef;
Run Code Online (Sandbox Code Playgroud)

@ViewChild('searchText', {read: ElementRef, static: true})
public searchTextInput: ElementRef;
Run Code Online (Sandbox Code Playgroud)

哪个更好?什么时候应该使用static:truevs static:false

typescript viewchild angular angular8

125
推荐指数
4
解决办法
3万
查看次数

MongoDB从3.2转储,恢复为3.4,错误索引safe = null

我收到以下错误(转储MongoDB 3.2)(恢复MongoDB 3.4):

Failed: ngivr-dev.ledgerhelpers: error creating indexes for ngivr-dev.ledgerhelpers: **createIndex error:** **The field 'safe' is not valid for an index specification.** Specification: **{ unique: true, name: "ledgerId_1", safe: null, ns: "ngivr-dev.ledgerhelpers", background: true, key: { ledgerId: 1 } }**
Run Code Online (Sandbox Code Playgroud)

看起来安全索引为null.但是我如何在MongoDB 3.4中使用它?3.2没关系.

mongodb mongorestore mongodump

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

git是什么意思,"无法将对象迁移到永久存储"?

git是什么意思,"无法将对象迁移到永久存储"?

 Counting objects: 4, done.
 Delta compression using up to 8 threads.
 Compressing objects: 100% (4/4), done.
 Writing objects: 100% (4/4), 956 bytes | 0 bytes/s, done.
 Total 4 (delta 2), reused 0 (delta 0)
 error: failed to push some refs to 'https://git.patrikx3.tk/server-scripts.git'
 To https://git.patrikx3.tk/server-scripts.git
 !  refs/heads/master:refs/heads/master [remote rejected] (unable to migrate objects to permanent storage)
 Done
Run Code Online (Sandbox Code Playgroud)

git git-push

7
推荐指数
2
解决办法
6987
查看次数

即使我使用目标 esm2015,ivy 也编译为 esm5 模块

@angular 常春藤问题

描述

当我使用 ng cli 时,它将模块编译为 esm2015,我的问题是我有一个旧系统,因为 angular 2 次,我使用 webpack,但对我来说它编译为 es5。

如何更改它以编译为 esm2015?

最小复制

我的 tsconfig.aot.json:

{
    "compilerOptions": {
        "rootDir": ".",
        "baseUrl": ".",
        "skipLibCheck": true,
        "outDir": "build/aot",
        "target": "es2015",
        "module": "esnext",
        "moduleResolution": "node",
        "sourceMap": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "noImplicitAny": true,
        "suppressImplicitAnyIndexErrors": true,
        "lib": [
            "es2018",
            "dom"
        ],
        "paths": {
            "corifeus-web-material": [
                "build-modules/corifeus-web-material/index.ts"
            ],
            "corifeus-web": [
                "build-modules/corifeus-web/index.ts"
            ],
            "corifeus-web-material/*": [
                "build-modules/corifeus-web-material/*"
            ],
            "corifeus-web/*": [
                "build-modules/corifeus-web/*"
            ]
        }
    },
    "include": [
        "build-modules/**/*",
        "src/angular/**/*",
        "test/angular-webpack/**/*"
    ],
    "exclude": [
        "src-save",
        "*.worker.js", …
Run Code Online (Sandbox Code Playgroud)

angular-cli

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

隐藏Angular 2材质工具提示,如ngIf

在Angular 1 Material中我可以使用一个指令,现在它是一个属性,现在很难做到.我怎么能这样做只是为了只显示工具提示,就像页面宽度小,隐藏什么时候大?

我找不到.它不可能像以下一样使用:

<md-tooltip ngIf="false">sometimes hidden</md-tooltip>
Run Code Online (Sandbox Code Playgroud)

tooltip angular-material2 angular

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

材料2 paletta对比色

在paletta中,我可以看到对比.如何选择对比色?

作品:

scss
mat-color($button-primary);
Run Code Online (Sandbox Code Playgroud)

不工作

scss 
mat-color($button-primary, contrast(900));
Run Code Online (Sandbox Code Playgroud)

在底部看它说对比.

scss
$mat-red: (
  50: #ffebee,
  100: #ffcdd2,
  200: #ef9a9a,
  300: #e57373,
  400: #ef5350,
  500: #f44336,
  600: #e53935,
  700: #d32f2f,
  800: #c62828,
  900: #b71c1c,
  A100: #ff8a80,
  A200: #ff5252,
  A400: #ff1744,
  A700: #d50000,
  contrast: (
    50: $black-87-opacity,
    100: $black-87-opacity,
    200: $black-87-opacity,
    300: $black-87-opacity,
    400: $black-87-opacity,
    500: white,
    600: white,
    700: white,
    800: $white-87-opacity,
    900: $white-87-opacity,
    A100: $black-87-opacity,
    A200: white,
    A400: white,
    A700: white,
  )
);
Run Code Online (Sandbox Code Playgroud)

我该如何使用对比度?

angular-material angular

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