我正在使用此技术动态创建组件:
import {
Component, Input, ViewContainerRef, ViewChild, ReflectiveInjector, ComponentFactoryResolver,
Output, EventEmitter
} from '@angular/core';
@Component({
selector: 'dynamic-component',
template: `
<div #dynamicComponentContainer></div>
`,
})
export default class DynamicLayerComponent {
currentComponent = null;
@ViewChild('dynamicComponentContainer', { read: ViewContainerRef }) dynamicComponentContainer: ViewContainerRef;
@Output() visibility = new EventEmitter<boolean>();
// component: Class for the component you want to create
// inputs: An object with key/value pairs mapped to input name/input value
@Input() set componentData(data: {component: any, inputs: any }) {
console.log('setting');
if (!data) {
return;
} …Run Code Online (Sandbox Code Playgroud) 当我尝试在HTTP请求的主体中输入任何内容时,当我点击其他任何内容时,我得到:
您无法切换,因为数据无法转换为Target选项卡数据,空数据要切换
那是什么 ?我正在运行Windows 10.
我想知道如何在 gitlab 持续集成中为失败的构建生成工件,以查看构建生成的 html 报告。
我试过这样:
artifacts:
when: on_failure
paths:
- SmokeTestResults/
- package.json
Run Code Online (Sandbox Code Playgroud)
但不幸的是它不起作用。我正在使用 Gitlab 8.11.4 社区版。
问题是原型未定义,尽管在节点控制台中编写http.IncomingMessage.prototype确实将对象作为输出.有任何想法吗 ?
var req = Object.create(http.IncomingMessage.prototype)
Uncaught TypeError: Cannot read property 'prototype' of undefined
at http://localhost:62625/____wallaby-bundle.js?1501265946287&wallabyFileId=bundle:219253
Run Code Online (Sandbox Code Playgroud) 我有一个打字稿课程:
\n\nexport class SystemUnderTest {\n\n @LogThisAction('sth was done')\n public doSomething() {} \n\n}\nRun Code Online (Sandbox Code Playgroud)\n\n正如您所看到的,它使用反射来执行一些装饰函数:
\n\n export declare function LogThisAction(action: string): (target: any) => \n void;\nRun Code Online (Sandbox Code Playgroud)\n\n当我运行测试时,我不关心实际的实现。这个装饰器函数,所以我尝试像这样模拟它:
\n\n myModule = require(./DecoratorFunctions);\n myModule.LogThisAction = jest.fn();\nRun Code Online (Sandbox Code Playgroud)\n\n但这似乎不起作用。当我运行测试时我得到:
\n\n\xe2\x97\x8f Test suite failed to run\nTypeError: decorator is not a function\nat DecorateProperty (node_modules/reflect-metadata/Reflect.js:553:33)\nRun Code Online (Sandbox Code Playgroud)\n\n如何在JEST框架中实现我的目标?
\n配置:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"noEmitHelpers": true,
"lib": [
"es6",
"dom"
],
"types": [
"hammerjs",
"jasmine",
"node",
"selenium-webdriver",
"webpack",
"core-js",
"google-maps"
]
},
"exclude": [
"node_modules"
"e2e"
],
"include": [
"src/**/*"
],
"filesGlob": [
"./src/**/*.ts",
"./test/**/*.ts",
"!./node_modules/**/*.ts",
"./src/custom-typings.d.ts"
],
}
Run Code Online (Sandbox Code Playgroud)
执行 tsc 时出现以下错误:
node_modules/@types/core-js/index.d.ts(262,5): 错误 TS2687: 'flags' 的所有声明必须具有相同的修饰符。node_modules/@types/core-js/index.d.ts(276,5): 错误 TS2687: 'EPSILON' 的所有声明必须具有相同的修饰符。node_modules/@types/core-js/index.d.ts(311,5): 错误 TS2687: 'MAX_SAFE_INTEGER' 的所有声明必须具有相同的修饰符。node_modules/@types/core-js/index.d.ts(318,5): 错误 TS2687: 'MIN_SAFE_INTEGER' 的所有声明必须具有相同的修饰符。node_modules/@types/core-js/index.d.ts(457,5): 错误 TS2403: 后续变量声明必须具有相同的类型。变量 '[Symbol.toStringTag]' 的类型必须为 '"Symbol"',但这里的类型为 'string'。node_modules/@types/core-js/index.d.ts(457,5): 错误 TS2687: '[Symbol.toStringTag]' 的所有声明必须具有相同的修饰符。node_modules/@types/core-js/index.d.ts(464,5): …
我有几个像这样的元素:
<g transform="matrix">
<image xlink:href="data:image/png" width="48">
</g>
<g transform="matrix">
<image xlink:href="specyfic" width="48">
</g>
<g transform="matrix">
<image xlink:href="specyfic" width="48">
</g>
Run Code Online (Sandbox Code Playgroud)
我想选择名称中没有'specifiedc'的元素.问题是,有时会有一些NOT元素,有时甚至没有.NON specyfic图像计数始终是一个.
由于属性名称中的':',我无法实现这一点.
我试过这个:
public static getEventIconOnMap: ElementFinder =
element.all(by.css('image[width="48"]:not(image[xlink\\:href*="specyfic"'))).last();
Run Code Online (Sandbox Code Playgroud) 我有这个:
"latitude": ${__Random(-85,85)},
"longitude": ${__Random(-180,180)},
Run Code Online (Sandbox Code Playgroud)
我想要这个:
"latitude": ${__Random(42.06,42.08)},
"longitude": ${__Random(20.02,20.04)},
Run Code Online (Sandbox Code Playgroud)
但它不起作用。如何将其更改为 42.06 - 42.08 和 20.02 和 20.04 之间的随机数?
typescript ×5
javascript ×3
angular ×2
jmeter ×2
css ×1
gitlab ×1
gitlab-ci ×1
html ×1
jestjs ×1
node.js ×1
protractor ×1
testing ×1
tsc ×1
wallaby.js ×1
webdriver ×1