小编ESC*_*der的帖子

将 angular 8 应用程序迁移到 9 的奇怪问题

我正在将应用程序从 angular 8 迁移到 9。如果我尝试构建以进行部署,则会收到此错误消息

ERROR : Cannot assign value "$event" to template variable "value". Template variables are read-only.
    at _AstToIrVisitor.visitPropertyWrite (...\node_modules\@angular\compiler\bundles\compiler.umd.js:8617:31)
    at PropertyWrite.visit (...\node_modules\@angular\compiler\bundles\compiler.umd.js:7459:28)
    at convertActionBinding (...\node_modules\@angular\compiler\bundles\compiler.umd.js:8224:49)
    at prepareEventListenerParameters (...\node_modules\@angular\compiler\bundles\compiler.umd.js:16861:27)
    at Object.params (...\node_modules\@angular\compiler\bundles\compiler.umd.js:17952:24)
    at ...\node_modules\@angular\compiler\bundles\compiler.umd.js:17725:94
    at Array.map (<anonymous>)
    at ...\node_modules\@angular\compiler\bundles\compiler.umd.js:17725:60
    at ...\node_modules\@angular\compiler\bundles\compiler.umd.js:17014:87
    at Array.map (<anonymous>)
    at TemplateDefinitionBuilder.buildTemplateFunction (...\node_modules\@angular\compiler\bundles\compiler.umd.js:17014:60)
    at ...\node_modules\@angular\compiler\bundles\compiler.umd.js:17558:60
    at ...\node_modules\@angular\compiler\bundles\compiler.umd.js:16992:81
    at Array.forEach (<anonymous>)
    at TemplateDefinitionBuilder.buildTemplateFunction (...\node_modules\@angular\compiler\bundles\compiler.umd.js:16992:37)
    at Object.compileComponentFromMetadata (...\node_modules\@angular\compiler\bundles\compiler.umd.js:18643:58)
Run Code Online (Sandbox Code Playgroud)

我怎样才能发现问题发生了?

angular

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

Azure AD SPA 应用程序“IDX10511:签名验证失败”

我有一个源自 Identity Platform 示例的 SPA 应用程序,该示例最初调用图形 API。

我已更改端点以调用本地 API。

SPA 使用 Azure AD 进行身份验证。

API 示例源自 API 的 VS 2019 项目模板。

,NET 4.7.2 - 无 .NET Core。

我可以进行身份​​验证,并且在进行网络跟踪时 ID 和访问令牌都存在。

但是,在 API 方面我收到错误:

"IDX10511: Signature validation failed. Keys tried: 'Microsoft.IdentityModel.Tokens.X509SecurityKey, KeyId: '1E50B4475DAC931359D564309A3385FFAB7FB431', InternalId: 'f61f7746-3cff-4557-8b2c-b47fad9cf1e3'. , KeyId: 1E50B4475DAC931359D564309A3385FFAB7FB431"
Run Code Online (Sandbox Code Playgroud)

解码访问令牌显示:

"{
  "typ": "JWT",
  "nonce": "G0Q6_BuYJUfZaBnX-l1Ox1eoncxXRT4KMThFBcn1-VA",
  "alg": "RS256",
  "x5t": "HlC0R12skxNZ1WQwmjOF_6t_tDE",
  "kid": "HlC0R12skxNZ1WQwmjOF_6t_tDE"
}"
Run Code Online (Sandbox Code Playgroud)

谷歌搜索一下,似乎签名因标头中的随机数而失败,这需要“特殊处理”。

所有验证均由 OWIN 完成。

知道这是什么或如何解决这个问题吗?

jwt single-page-application owin azure-active-directory

9
推荐指数
1
解决办法
5733
查看次数

如何修复 React '未定义 no-undef'?

我正在尝试为电影列表中的每部电影创建详细视图。我有 Django 作为后端,React 作为前端。

当我尝试对每部电影进行详细查看时,出现错误。

错误日志:

Failed to compile.

./src/components/movie-list.js
  Line 5:26:  'movie' is not defined  no-undef
  Line 6:28:  'movie' is not defined  no-undef

Search for the keywords to learn more about each error.
Run Code Online (Sandbox Code Playgroud)

我尝试过绑定,但不完全明白问题出在哪里。

应用程序.js

import React, { Component } from 'react';
import MovieList from "./components/movie-list";

  componentDidMount() {
    //fetch data
    fetch('http://127.0.0.1:8000/api/movies/', {
      method: 'GET',
      headers: {
        'Authorization': 'Token 8588cb6fcc2ee0bf9915d4c6b720554347d5883f'
      }
    }).then(resp => resp.json())
      .then(res => this.setState({ movies: res }))
      .catch(error => console.log(error))
  }

  movieClicked = movie => {
    console.log(movie); …
Run Code Online (Sandbox Code Playgroud)

reactjs

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

所有 Kubernetes 代理目标都关闭 - Prometheus Operator

我在 openstack 中部署了一个 k8s 集群。我已经为它部署了 Prometheus operator 来监控集群。但是我收到了所有节点的 Kubernetes 代理停机警报。

我想知道 Prometheus operator 如何抓取 Kubernetes 代理的基础知识?还想知道需要做哪些配置来修复它。

我可以看到 kube 代理正在 10249 端口的所有节点中运行。

错误 :

Get http://10.8.10.11:10249/metrics: dial tcp 10.8.10.11:10249: connect: connection refused
Run Code Online (Sandbox Code Playgroud)

HELM 值配置

kubeProxy:
  enabled: true

  ## If your kube proxy is not deployed as a pod, specify IPs it can be found on
  ##
  endpoints: []
  # - 10.141.4.22
  # - 10.141.4.23
  # - 10.141.4.24

  service:
    port: 10249
    targetPort: 10249
    # selector:
    #   k8s-app: kube-proxy

  serviceMonitor:
    ## Scrape interval. …
Run Code Online (Sandbox Code Playgroud)

kubernetes prometheus prometheus-operator

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

Netplan 错误:无法绑定到端口 2893,地址已在使用中

我想在 Ubuntu 中配置静态 IP 地址。在这里你可以看到我的静态IP寻址配置文件:

  network:
  version: 2
  renderer: NetworkManager
   ethernets:
       wlp1s0:
          dhcp4: no
          addresses: [192.168.0.103/24]
          Gateway: 192.168.0.1
          Nameservers:
             Addresses: [127.0.0.53]

Run Code Online (Sandbox Code Playgroud)

在通过 测试配置时$ sudo netplan try,我得到以下响应:

绑定:地址已在使用中

netplan:致命错误:无法绑定到端口 2983,是否有另一个守护进程正在运行?正在退出。

Netstat 显示 Netplan 正在使用的端口。

netstat -pnlt | grep ':2983'
Run Code Online (Sandbox Code Playgroud)

tcp 0 0 0.0.0.0:2983 0.0.0.0:* LISTEN 1524/netplan

那么有人可以给我一个解决这个问题的方法吗?

networking

5
推荐指数
1
解决办法
9134
查看次数

“由于值具有类型而发生移动”Rust 错误

我正在学习 Rust,但我不明白以下代码的问题是什么

pub enum BagEntryState {
    UNUSED, USED, REMOVED
}

impl PartialEq for BagEntryState {
    fn eq(&self, other: &Self) -> bool {
        self == other
    }
}

pub struct BagEntry< T: std::cmp::PartialEq + fmt::Display> {
    state : BagEntryState,
    value: T,
}

impl<'a, T: std::cmp::PartialEq + fmt::Display> BagEntry<T> {
    pub fn new(value: T) -> BagEntry< T> {
        BagEntry {
            value,
            state: BagEntryState::UNUSED,
        }
    }

    pub fn value(self)->T {
        self.value
    }
}

impl<'a, T: std::cmp::PartialEq + fmt::Display> PartialEq for BagEntry<T> {
    fn …
Run Code Online (Sandbox Code Playgroud)

rust

5
推荐指数
1
解决办法
7917
查看次数

有没有办法使用 Terraform 将具有“所有者角色”(角色/所有者)的新用户添加到谷歌云项目?

我是 terrafrom 的新手,并尝试使用 terraform 将新用户添加到我现有的 GCP 项目中。

provider "google" {
  project = var.project_id
  region  = var.region
}


resource "google_project_iam_member" "project" {
  project = var.project_id
  role    = "roles/owner"
    member = "user:abc@gmail.com"
}
Run Code Online (Sandbox Code Playgroud)

但它根本不起作用。虽然它给了我错误:

Batch "iam-project-test modifyIamPolicy" for request "Create IAM Members 
roles/owner user:abc@gmail.com for \"project \\\"test\\\"\"" returned 
error: Error applying IAM policy for project "test": Error setting IAM policy for
project "test": googleapi: Error 400: Request contains an invalid argument., badRequest.
Run Code Online (Sandbox Code Playgroud)

google-cloud-platform terraform terraform-provider-gcp

5
推荐指数
1
解决办法
515
查看次数

如何设计 ng-bootstrap 手风琴?

我想为 ng-bootstrap 的手风琴添加自定义淡入淡出样式!我怎样才能实现它?

ng-bootstrap angular angular9

5
推荐指数
1
解决办法
2875
查看次数

错误 TS1086 无法在环境上下文中声明访问器。获取 firebaseUiConfig(): NativeFirebaseUIAuthConfig

使用 Angular/CLI 8 构建 SPA。在本地运行直到成功。将 Firebase 身份验证添加到应用程序。通过 VSC 编译时收到以下错误消息:

node_modules/firebaseui-angular/lib/firebaseui-angular-library.component.d.ts:17:9 中的错误 - 错误 TS1086:无法在环境上下文中声明访问器。

17 get firebaseUiConfig(): NativeFirebaseUIAuthConfig; ~~~~~~~~~~~~~~~~

冉: npm install firebase firebaseui @angular/fire firebaseui-angular --save

Ran:ng serve本地编译查看,报错。

Using: 
typescript ~3.5.3
firebase ^7.13.2
firebaseui ^4.5.0
firebaseui-angular ^4.1.0
angular/cli ~8.3.25
angular/compiler-cli ~8.2.14
angular-devkit/build-angular ~0.803.25
Running on MacPro Catalina v-10.15.3
Run Code Online (Sandbox Code Playgroud)

在stackoverflow上看过其他类似的帖子。没有发现任何与相同情况有关的东西。尝试了一些帮助其他人解决类似问题但其他情况的解决方案,例如角度动画和 flex-layout。这两个案例都降低了每个版本。也曾尝试将 firebaseui 的版本从 4.5.0 降低到 3.6.0 无济于事。

typescript firebase-authentication firebaseui angular

5
推荐指数
1
解决办法
1682
查看次数

Android XzingScanner:如何自定义ZshingScanner布局?(添加按钮)

我正在使用 Zxing Scanner 实现条形码扫描仪,这部分的一切都正常,但现在我想在布局上添加一个按钮(用于打开/关闭手电筒)。我在互联网上到处查了一下,但一无所获。

所以,这是我的问题:

  • 是否可以修改 .xml 以添加按钮?如果是,如何找到这个文件?

  • 是否已经在某处实现了在布局中添加一些元素的功能?

这就是我调用 ZXingScannerView 的方式:

scannerView = new ZXingScannerView(this);
setContentView(scannerView);
Run Code Online (Sandbox Code Playgroud)

java xml layout android zxing

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

如何在Angular项目中集成CKEditor的上传图片插件

我想在 CKEditor 中添加“选择文件选项”。为此,我指的是有关上传图像插件的文档

在此输入图像描述

单击此图像图标时,将打开以下窗口

在此输入图像描述

没有上传图像选项(选择文件选项)。我想将这个插件与 CKEditor 一起添加。有什么方法可以使用 npm 添加这个吗?

或者有什么其他方法可以在 CKEditor 4 中包含此功能?

ckeditor ckeditor4.x angular

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

使用Java流解析JsonArray结果

我正在尝试从 JsonArray 获取键的值。结果,我得到了 JsonObject,格式如下

{
  "docs": [
    {
      "_index": "esindex",
      "_type": "esmessage",
      "_id": "4",
      "_version": 1,
      "found": true,
      "_source": {
        "account_number": 4,
        "balance": 27658
      }
    }
  ]
}
Run Code Online (Sandbox Code Playgroud)

我需要找到id所有这些文件的"found": true. 生成的 JsonArray 的格式为

[
  {
    "_index": "esindex",
    "_type": "esmessage",
    "_id": "4",
    "_version": 1,
    "found": true,
    "_source": {
      "account_number": 4,
      "balance": 27658
    }
  }
]
Run Code Online (Sandbox Code Playgroud)

我可以使用下面的java代码获取所有id的列表

 List<Integer> documents = new ArrayList<>();
JsonObject result = esClient.execute(builder.build()).getJsonObject();
        JsonArray jsonArray = result.getAsJsonObject().get("docs").getAsJsonArray();
        while (i < request.getIds().size()) {
            JsonPrimitive checkIfExists = …
Run Code Online (Sandbox Code Playgroud)

java gson java-stream

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

IONIC 4:任务“:app:transformDexArchiveWithExternalLibsDexMergerForDebug”执行失败

我在构建 ionic 4 应用程序时遇到问题。每次我尝试构建 android 应用程序时,它都会出现以下错误。

FAILURE: Build failed with an exception.

* What went wrong: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:   Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes. Program type already present: android.support.v4.os.ResultReceiver$MyResultReceiver

* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 19s …
Run Code Online (Sandbox Code Playgroud)

dex firebase ionic-framework angular ionic4

0
推荐指数
1
解决办法
2237
查看次数