小编Abd*_*rim的帖子

如何在non angularjs网站上使用量角器?

我找到了为AngularJS Web应用程序制作的Protractor框架.

如何在不使用AngularJS的网站上使用Protractor?

我写了第一个测试,Protractor触发了这条消息:

Error: Angular could not be found on the page https://www.stratexapp.com/ : retries looking for angular exceeded
Run Code Online (Sandbox Code Playgroud)

javascript asp.net testing protractor

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

Build:element隐式具有'any'类型,因为索引表达式不是'number'类型

我们正在编写TypeScript 1.8代码,迫使软件开发人员设置类型.

以下是错误消息:

  • 说明:构建:元素隐式具有"任意"类型,因为索引表达式不是"数字"类型.
  • 项目myProject
  • 文件:C:\ dev\Scripts\machines.ts
  • 线:77,78,80,81,96,110,111,220
  • 来源:构建

我们应该如何定义这些变量的类型?

  • _matrixQuantityProduct
  • _matrixQuantityLotSizeProduct
  • matrixQuantityProduct2
  • matrixQuantityLotSizeProduct2

源代码

    private _machines: Machine[];
    private _matrixQuantityProduct: Array<Array<number>>;
    private _matrixQuantityLotSizeProduct: Array<Array<number>>;
    private buildMatrixQuantity() {
        let matrixQuantityProduct : Array<Array<number>> = new Array();
        let matrixQuantityLotSizeProduct: Array<Array<number>> = new Array();

        // on cree le array 2D et les clés dynamiques
        for (let i = 0; i < this._machines.length; i++) {
            let matrixQuantityProduct2 : Array<any> = [];
            let matrixQuantityLotSizeProduct2: Array<any>  = [];
            for (let j = 0; j < this._machines.length; …
Run Code Online (Sandbox Code Playgroud)

typescript typescript1.8

13
推荐指数
1
解决办法
4万
查看次数

错误 TS2339:类型“响应”上不存在属性“结果”

我遵循了一段代码构建和应用程序,使用 angular2、typescript 和 firebase 从 last.fm 收集数据。

源代码可以在这里找到: https: //github.com/vtts/mytunes

问题:如何转换 json 调用的结果?

github上的源代码

https://github.com/vtts/mytunes/blob/master/app/music/services/music.srv.ts

我收到以下错误:

app/music/services/music.service.ts(29,39): error TS2339: Property 'results' does not exist on type 'Response'. 
app/music/services/music.service.ts(51,36): error TS2339: Property 'album' does not exist on type 'Response'.
Run Code Online (Sandbox Code Playgroud)

包.json

{
  "name": "mytunes",
  "version": "1.0.0",
  "scripts": {
    "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
    "lite": "lite-server",
    "postinstall": "typings install",
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "typings": "typings"
  },
  "license": "ISC",
  "dependencies": {
    "angular2": "2.0.0-beta.15",
    "bootstrap": "^3.3.6",
    "es6-shim": "^0.35.0", …
Run Code Online (Sandbox Code Playgroud)

json last.fm firebase typescript1.8 angular

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

Gunicorn 20 未能在“索引”中找到应用程序对象“app.server”

我正在使用 Gunicorn 部署我的 Dash 应用程序。升级到 Gunicorn 20.0.0 后,找不到我的应用程序。

gunicorn --bind=0.0.0.0 --timeout 600 index:app.server
Run Code Online (Sandbox Code Playgroud)
Failed to find application object 'app.server' in 'index'
[INFO] Shutting down: Master
[INFO] Reason: App failed to load.
Run Code Online (Sandbox Code Playgroud)

Gunicorn 的问题跟踪器上的这个问题似乎与错误有关,但我不知道我应该怎么做来修复它。如何让 Gunicorn 20 找到我的应用程序?

index.py

import os
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
from pages import overview
from webapp import app

app.index_string = open(os.path.join("html", "index.html")).read()
app.layout = html.Div([
    dcc.Location(id="url", refresh=False),
    html.Div(id="page-content")
])

@app.callback(Output("page-content", "children"), [Input("url", "pathname")])
def display_page(pathname):
    if …
Run Code Online (Sandbox Code Playgroud)

python gunicorn plotly-dash

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

Angular 11:如何调试html内的变量?

用例

我想调试 Angular 11 Web 应用程序的 html 代码中的变量。

我设法获取ctx.ngForOf变量,但这是我所能做的。

我的程序中缺少某些内容,但我找不到缺少的内容。

感谢您花时间回答这个问题

工具

我在用

  • Visual Studio Code vscode
  • 角11

我尝试了什么?

  • 我发现ctx包含的变量ngForOf包含从 Web 服务检索的数据(20 项)。

ctx.ngForOf

    { 
        "adult": false,
        "backdrop_path": "/pcDc2WJAYGJTTvRSEIpRZwM3Ola.jpg",
        "genre_ids": [
            28,
            12,
            14,
            878
        ],
        "id": 791373,
        "original_language": "en",
        "original_title": "Zack Snyder's Justice League",
        "overview": "Determined to ensure Superman's ultimate sacrifice was not in vain, Bruce Wayne aligns forces with Diana Prince with plans to recruit a team of metahumans to protect the …
Run Code Online (Sandbox Code Playgroud)

visual-studio-debugging angular chrome-debugging

5
推荐指数
2
解决办法
7422
查看次数

Azure WebApps React:环境变量存在,但当我调用 process.env 时不存在

先决条件

\n

这是我第一次使用 React/Node.JS/Azure App Service。我通常使用flask/jinja2/gunicorn来部署应用程序。

\n

用例

\n

我想使用存储在Azure 上的应用服务配置中的环境变量

\n

不幸的是,环境变量显示了 3 个环境变量(NODE_END、PUBLIC_URL 和 FAST_REFRESH),而不是几十个

\n

Azure App Service appsettings的部分内容

\n
[\n{\n    "name": "REACT_APP_APIKEY",\n    "value": "some key",\n    "slotSetting": false\n  },\n  {\n    "name": "REACT_APP_APPID",\n    "value": "an app id",\n    "slotSetting": false\n  },\n  {\n    "name": "REACT_APP_AUTHDOMAIN",\n    "value": "an auth domain",\n    "slotSetting": false\n  },\n{\n    "name": "APPINSIGHTS_INSTRUMENTATIONKEY",\n    "value": "something",\n    "slotSetting": false\n  },\n  {\n    "name": "APPLICATIONINSIGHTS_CONNECTION_STRING",\n    "value": "something else",\n    "slotSetting": false\n  },\n  {\n    "name": "ApplicationInsightsAgent_EXTENSION_VERSION",\n    "value": "some alphanumeric …
Run Code Online (Sandbox Code Playgroud)

node.js reactjs azure-web-app-service

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

如何查询一个json文件?

这是我想解析的文件

  1. 我从 JSON 格式的网络服务接收文件。
  2. 我想以显示美国总统姓名的方式解析内容
{
    "response": {
        "result": {
            "Countries": {
                "row": [
                    {
                        "no": "1",
                        "FL": [
                            {
                                "content": "USA",
                                "val": "Country"
                            },
                            {
                                "content": "Barack Obama",
                                "val": "President"
                            }
                        ]
                    },
                    {
                        "no": "2",
                        "FL": [
                            {
                                "content": "Cuba",
                                "val": "Country"
                            },
                            {
                                "content": "Raul Castro",
                                "val": "President"
                            }
                        ]
                    }
                ]
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

预期输出

{ presidents: [
    { "name": "Barack Obama"}
    ]
}
Run Code Online (Sandbox Code Playgroud)

你能提供一个使用一种 JSON XPath 的解决方案吗?

javascript xpath json jsonpath typescript

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

Visual Studio Code cannot detect installed git AND 'error launching git: The filename or extension is too long.'

I have looked at most of the posts describing the first error on the title : "Visual Studio Code cannot detect installed git".

Nevertheless, I believe that the second error "error launching git: The filename or extension is too long." generates the first one.

Could you help me?

  1. Git works while using "Git Bash"
  2. VS Code indicates that git not found. install it or configure it using 'git.path' 找不到 vscode git。 使用“git.path”安装或配置它
  3. VS Code indicates that VSCODE : no source control providers registered …

git git-bash visual-studio-code vscode-settings

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

在 '@angular/core' Angular v8.1.0 中找不到导出 '??elementHostStyling'

先决条件

我刚刚将我的应用程序更新为以下软件包

"@angular/cdk": "^8.0.2",
"@angular/common": "~8.0.3",
"@angular/compiler": "~8.0.3",
"@angular/core": "^8.1.0",
"@angular/forms": "^8.1.0",
"@angular/platform-browser-dynamic": "^8.1.0",
"@angular/platform-browser": "^8.1.0",
"@angular/router": "^8.1.0",
"@angular-devkit/build-angular": "^0.800.6",
"@angular-devkit/build-ng-packagr": "~0.800.6",
"@angular-devkit/build-optimizer": "^0.800.6",
"@angular/animations": "^8.1.0",
"@angular/cli": "^8.1.0",
"@angular/compiler-cli": "^8.1.0",
"@angular/language-service": "^8.1.0"
Run Code Online (Sandbox Code Playgroud)

编译失败

我已经运行了我的命令npm run watch并且出现了以下错误

"build-libs": "npm run build-helper-messages && npm run build-kpi-mrr && npm run build-kpi",
"watch": "npm run build-libs &&  ng serve --watch --open --ssl true"
Run Code Online (Sandbox Code Playgroud)

./node_modules/@angular/common/fesm2015/common.js 4031:8-28 中的错误“在‘@angular/core’中找不到导出‘??elementHostStyling’

./node_modules/@angular/common/fesm2015/common.js 5468:8-28 中的错误“在‘@angular/core’中找不到导出‘??elementHostStyling’

./node_modules/@angular/common/fesm2015/common.js 4035:8-33 中的错误“在‘@angular/core’中找不到导出‘??elementHostStylingApply’

./node_modules/@angular/common/fesm2015/common.js 5472:8-33 中的错误“在‘@angular/core’中找不到导出‘??elementHostStylingApply’

./node_modules/@angular/common/fesm2015/common.js 4034:8-31 中的错误“在‘@angular/core’中找不到导出‘??elementHostStylingMap’

./node_modules/@angular/common/fesm2015/common.js 5471:8-31 中的错误“在‘@angular/core’中找不到导出‘??elementHostStylingMap’

你知道如何解决这个问题吗?

npm angular

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