我正在使用Angular 2.当我尝试导入"@ angular/material"时,我收到了错误.我正在导入类似的包:
import {MdDialog} from "@angular/material";
import {MdDialogRef} from "@angular/material";
Run Code Online (Sandbox Code Playgroud)
我的tsconfig.json文件如:
{
"compilerOptions": {
"baseUrl": "",
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es6", "dom"],
"mapRoot": "./",
"module": "es6",
"moduleResolution": "node",
"outDir": "../dist/out-tsc",
"sourceMap": true,
"target": "es5",
"typeRoots": [
"../node_modules/@types"
]
}
}
Run Code Online (Sandbox Code Playgroud)
我的package.json代码:
{
"name": "rmc-temporary",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"start": "ng serve",
"lint": "tslint \"src/**/*.ts\"",
"test": "ng test",
"pree2e": "webdriver-manager update",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"@angular/common": "2.2.1",
"@angular/compiler": "2.2.1",
"@angular/core": …
Run Code Online (Sandbox Code Playgroud) 我正在使用角度为2的绘图代码.我在下面的代码时遇到错误.我提到了这段代码.
我的代码是:
var plotDiv = document.getElementById('myDiv');
plotDiv.on('plotly_relayout',
function(eventdata){
alert( 'ZOOM!' + '\n\n' +
'Event data:' + '\n' +
JSON.stringify(eventdata) + '\n\n' +
'x-axis start:' + new Date(eventdata['xaxis.range[0]'])+ '\n' +
'x-axis end:' + new Date(eventdata['xaxis.range[1]']));
var xVal = new Date(eventdata['xaxis.range[0]']);
var yVal = new Date(eventdata['xaxis.range[1]']);
}
);
Run Code Online (Sandbox Code Playgroud)
我收到了plotDiv.on('....')函数的错误.在角度2中是否有.on()的替代功能?请帮我.我卡在这里
我正在将我的应用程序从Spring 3.x升级到Spring 4.3。而不是xml配置,我想进行java配置(注释)。我无法使用注释进行配置。
<task:executor id="executor" pool-size="8-25" queue-capacity="100" />
<task:scheduler id="scheduler" pool-size="10" />
<context:component-scan annotation-config="true" base-package="com.jobs"/>
<task:annotation-driven executor="executor" scheduler="scheduler" />
Run Code Online (Sandbox Code Playgroud)
使用注释在何处以及如何配置以上配置。我想将上述xml配置应用于以下MyClassName.java
<bean id="mcn" class="com.jobs.MyClassName">
<property name="username" value="...."/>
<property name="authorities">
<list>
<value>....</value>
</list>
</property>
</bean>
Run Code Online (Sandbox Code Playgroud)
我试过像使用注解的以下配置,但出现异常:
Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanInitializationException: Properties 'authorities' and 'username' are required for bean 'myClassName'
Run Code Online (Sandbox Code Playgroud)
MyClassName.java
@Component
public class MyClassName{
@Value("CronUser")
private String username;
//@Value("#{'ROLE_SYSTEM'.split(',')}")
@Value("#{'ROLE_SYSTEM'}")
private List<String> authorities;
@Required
public
void setUsername(final String aUsername)
{
username = aUsername;
}
@Required
public
void setAuthorities(final …
Run Code Online (Sandbox Code Playgroud) 我想从图中删除这条线。但我没有得到任何解决方案。
我参考了这段代码。
以下是我的代码:demo.html
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js">
</script>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
</head>
<body>
<div id="myDiv" style="width: 480px; height: 400px;"><!-- Plotly chart will be drawn inside this DIV --></div>
<script>
var trace1 = {
x: ['2013-10-04 22:23:00', '2016-10-06 22:23:00', '2013-11-04 22:23:00', '2013-11-07 22:23:00','2013-12-04 22:23:00', '2013-12-08 22:23:00'],
y: [1, 3, 6,9, 4, 5],
fill: 'tozeroy',
fillcolor: 'red',
text: server1,
hoverinfo: "x+y+text",
name:"Server 1",
type: 'scatter',
mode:"markers",
marker:
{
size:5,
color:"gray"
},
uid:"c2e171"
};
var layout = {
margin: {
l: 35, …
Run Code Online (Sandbox Code Playgroud) 我想使用我的 Flask Web 应用程序配置 postgresql。我不想使用任何 ORM。我只想使用简单的 postgresql 请用示例指导我。我对这项技术很陌生。
我想从 python 应用程序在 JFrog 存储库中保存/存储 pdf文件。为此,我在本地系统上安装了 JFrog 社区版本。但是我混淆了需要选择哪个 JFrog 存储库来保存 PDF 文件。
请指导我。我对此很陌生。
我知道这是一个愚蠢的问题,但我无法做到.我声明变量arr = []; 我正在动态推动对象价值.但没有运气.我想要以下格式的数组
arr[
{name:"abc"},
{name:"pqr"}
];
Run Code Online (Sandbox Code Playgroud)
但我无法进入上述格式.我的代码是:
var arr= [];
for (let i = 1; i < 100; i++) {
let lg= {
name:list[i]
};
arr.push(lg);
}
Run Code Online (Sandbox Code Playgroud)
哪里我做错了.请帮我.
plotly ×3
python ×3
typescript ×3
angular ×2
javascript ×2
aem ×1
artifactory ×1
d3.js ×1
flask ×1
postgresql ×1
repository ×1
spacy ×1
spring ×1
spring-mvc ×1