版本:Cordova:6.3.1,Gulp CLI:1.2.2,离子框架:2.0.0-rc.0,Ionic CLI版本:2.1.0
我在ionic2应用程序中使用ng2-charts.
进口不受import {ChartsModule} from "ng2-charts";
而是import {ChartsModule} from "ng2-charts/components/charts/charts;"因为这个(问题#440)
我的整个app.module.ts
import { NgModule } from '@angular/core';
import { IonicApp, IonicModule } from 'ionic-angular';
import { ChartsModule } from 'ng2-charts/components/charts/charts';
import { MyApp } from './app.component';
import { EventsPage } from '../pages/events/events.component';
import { ChartComponent } from '../pages/chart/chart.component';
import { APICaller } from '../services/APICaller.service';
import { EventDetailComponent } from '../pages/event-detail/event-detail.component';
import { ParticipantDetail } from '../pages/participant-detail/participant-detail.component';
import { ParticipantFeedComponent } from …Run Code Online (Sandbox Code Playgroud) 我不知道如何使用getUserHeaders()我当前返回的Observable的值http.get.
Type 'Observable<void>' is not assignable to type 'Observable<Participant[]>'
能够使用我的Observable返回方法的值getUserHeaders()作为调用中的headers属性http.而只返回http调用的Observable.
(使用由getUserHeaders()(不是Observable或者Promise)返回的harcoded Headers .
getAllParticipants(): Observable<Array<Participant>> {
return this.http.get('someUrl',
{headers: this.getUserHeaders()})
.map(response => {
return response.json();
});
});
}
Run Code Online (Sandbox Code Playgroud)
通过使用TypeScript的答案从Angular2中的http数据链接RxJS Observables,我来到了该flatMap方法.(注意此代码当前抛出'当前错误')
getUserHeaders(): Observable<Headers> {
let headers: Headers = new Headers();
return NativeStorage.getItem("user").map(
data => {
headers.append('API_KEY', data.json().apiKey);
headers.append('DEVICE_ID', data.json().deviceId);
return …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用SSL配置我的Jetty.现在我只是坚持为什么它不能在HTTPS上连接.它在HTTP上工作正常.
$ {} JETTY_HOME /etc/jetty-https.xml
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/config
ure_9_3.dtd">
<!-- ============================================================= -->
<!-- Configure a HTTPS connector. -->
<!-- This configuration must be used in conjunction with jetty.xml -->
<!-- and jetty-ssl.xml. -->
<!-- ============================================================= -->
<Configure id="sslConnector" class="org.eclipse.jetty.server.ServerConnector">
<Call name="addIfAbsentConnectionFactory">
<Arg>
<New class="org.eclipse.jetty.server.SslConnectionFactory">
<Arg name="next">http/1.1</Arg>
<Arg name="sslContextFactory"><Ref refid="sslContextFactory"/></Arg>
</New>
</Arg>
</Call>
<Call name="addConnectionFactory">
<Arg>
<New class="org.eclipse.jetty.server.HttpConnectionFactory">
<Arg name="config"><Ref refid="sslHttpConfig" /></Arg>
<Arg name="compliance"><Call class="org.eclipse.jetty.http.HttpCompliance" name="
valueOf"><Arg><Property name="jetty.http.compliance" default="RFC7230"/></Arg></Call></Ar
g>
</New>
</Arg>
</Call>
</Configure>
Run Code Online (Sandbox Code Playgroud)
$ {} JETTY_HOME …
我有一个我想测试的Kotlin应用程序.我的tests(.kt)文件在Eclipse中成功执行.(测试本身是一个h2 mockjdbc测试).
现在运行mvn test -X时说:
releases: [enabled => true, update => never]
]
[DEBUG] (s) reportFormat = brief
[DEBUG] (s) reportsDirectory = C:\Users\Ivar\workspace\anotherworkspace\newrestservice\complete\target\surefire-reports
[DEBUG] (f) rerunFailingTestsCount = 0
[DEBUG] (f) reuseForks = true
[DEBUG] (s) runOrder = filesystem
[DEBUG] (f) shutdown = testset
[DEBUG] (s) skip = false
[DEBUG] (f) skipAfterFailureCount = 0
[DEBUG] (s) skipTests = false
[DEBUG] (s) suiteXmlFiles = []
[DEBUG] (s) testClassesDirectory = C:\Users\Ivar\workspace\anotherworkspace\newrestservice\complete\target\test-classes
[DEBUG] (s) testFailureIgnore = false
[DEBUG] …Run Code Online (Sandbox Code Playgroud) 我目前正在构建一个Ionic 2-RC3应用程序.但是自从我升级到RC-1后,我遇到了以下错误:(不确定他们是否保持不变,但你明白了).
[15:16:17] rollup: Conflicting namespaces:
C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\index.js re-exports 'TextAst' from
both
C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js
(will be ignored) and
C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js.
[15:16:17] rollup: Conflicting namespaces:
C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\index.js re-exports 'BoundTextAst'
from both
C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js
(will be ignored) and
C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js.
[15:16:17] rollup: Conflicting namespaces:
C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\index.js re-exports 'AttrAst' from
both
C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js
(will be ignored) and
C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js.
[15:16:17] rollup: Conflicting namespaces:
C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\index.js re-exports
'BoundElementPropertyAst' from both
C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js
(will be ignored) and
C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js.
[15:16:17] rollup: Conflicting namespaces:
C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\index.js re-exports
'BoundEventAst' from both
C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js
(will be ignored) and
C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js.
[15:16:17] rollup: Conflicting …Run Code Online (Sandbox Code Playgroud) 在Angular2中配置外部项目总是遇到一些麻烦.
我想在我的项目中包含ng2-sharebuttons.(似乎没有全局.d.ts文件?)
虽然README.md只是说npm install ng2-sharebuttons --save,我知道还有更多的东西(systemjs.config&typings)
首先,我尝试配置systemjs.config:
map{
......
'ng2-sharebuttons' : 'node_modules/ng2-sharebuttons'
}
Run Code Online (Sandbox Code Playgroud)
这至少固定在404上localhost/ng2-sharebuttons,但创造了一个新404的localhost/node_modules/ng2-sharebuttons.
所以,我添加了一个主文件,systemjs.config改为
map{
......
'ng2-sharebuttons' : 'node_modules/ng2-sharebuttons/dist/index.js'
}
Run Code Online (Sandbox Code Playgroud)
但现在这导致了404每个孩子ng2-sharebuttons/dist
我尝试过typings install ng2-sharebuttons --save --global,typings install @types/ng2-sharebuttons --save --global无论有没有--global旗帜.
所以在我最后的希望中,我添加了一个参考,看看是否可行.添加
/// <reference path="../../node_modules/ng2-sharebuttons/dist/index.d.ts" />
但这并没有改变任何事情.
我忘记了什么?为什么这么难?(或者我只是努力吗?)
结构和文件ng2-sharebuttons:
最后,Chrome目前正在生成错误消息:
整个 systemjs.config.js
/**
* System …Run Code Online (Sandbox Code Playgroud) 使用 swagger 2.0 时,java.util.Currency该类作为单独的定义生成。但是当我们生成 OpenAPI 3.0 时,我们遇到了 swagger-core 将其作为属性生成的问题。
我们有这个班级:
import java.util.Currency;
public class Wrapper {
private Currency currency;
}
Run Code Online (Sandbox Code Playgroud)
从这段代码中,我们使用以下插件配置生成 openapi 规范:
<plugin>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-maven-plugin</artifactId>
<version>2.0.9</version>
<configuration>
<outputFileName>openapi</outputFileName>
<outputFormat>YAML</outputFormat>
<outputPath>....</outputPath>
<resourcePackages>...</resourcePackages>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>resolve</goal>
</goals>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
生成时,这将导致此组件定义:
components:
schemas:
Wrapper:
type: "object"
properties:
currency:
type: object
properties:
currencyCode:
type: string
defaultFractionDigits:
type: integer
format: int32
numericCode:
type: integer
format: int32
displayName:
type: string
symbol:
type: string
Run Code Online (Sandbox Code Playgroud)
我正在尝试创建一个上传图片按钮,然后在另一个jsp页面上显示图像.
我想通过上传到app-root/data/images文件夹来做到这一点.这适用于以下文件路径:filePath = System.getenv("OPENSHIFT_DATA_DIR") + "images/";
但是如何在我的jsp上显示这个图像呢?我试过用:
<BODY>
<h1>SNOOP PAGE</h1>
<a href="profielMijnBedrijf.jsp">Ga weer terug</a>
<% String filepath = System.getenv("OPENSHIFT_DATA_DIR") + "images/";
out.println("<img src='"+filepath+"logo21.jpg'/>");
%>
<img src="app-root/data/images/logo21.jpg"/>
</BODY>
Run Code Online (Sandbox Code Playgroud)
这两个选项都不起作用.我还读到我需要创建一个符号链接.但是,当我在我的app-root/data或者app-root/data/images或app-root命令ln -s返回missing file operand
logo21.jpg确实出现在我的Git bash中
我正在尝试创建一个性别选择视图,包括男性,女性和其他(caitlyn jenner类型的东西).
我现在拥有的是:
在复选框的标签旁边有SVG(复选框将隐藏在生产中,现在在plunkr中可见,用于调试目的)
但当我点击"女性"时,它会将焦点更改为复选框而不是检查它.
Plunkr:http://plnkr.co/edit/Z0Dq2sfJaBrE6Mae2Kg1?p = info
码:
CSS
svg {
width: 15px; height: 15px;
border: 2px solid #a13b4a;
}
label {
display: inline-block;
padding-left: 1.5em;
position: relative;
cursor: pointer;
color: black;
}
input[type="checkbox"] {
opacity: 0;
width: 15px;
height: 15px;
}
label svg path {
transition: stroke-dashoffset .4s linear;
}
input[type="checkbox"]:checked ~ label svg path {
stroke-dashoffset: 0;
}
input[type="checkbox"]:checked ~ label {
color: #a13b4a;
}
Run Code Online (Sandbox Code Playgroud)
HTML
<div>
<input type="checkbox" id="male" [(ngModel)]="isMale" name="isMale"/>
<label (click)="select('male')" for="male">Male …Run Code Online (Sandbox Code Playgroud) 我有以下结构
Notification
|
------------------------
| |
SmsNotification EmailNotification
Run Code Online (Sandbox Code Playgroud)
包含一个包含 或的Notification枚举。现在我有一个类,其中包含一个.notificationTypeSMSEMAILInboxNotification
这是在 swagger yml 中指定的(删除了一些不相关的代码)
definitions:
Notification:
type: "object"
discriminator: "notificationType"
properties:
notificationType:
type: "string"
description: "Type of notification"
enum:
- "EMAIL"
- "SMS"
SmsNotification:
allOf:
- $ref: "#/definitions/Notification"
- type: "object"
EmailNotification
allOf:
- $ref: "#/definitions/Notification"
- type: "object"
Inbox:
type: "object"
properties:
notification:
description: "Latest received notification"
$ref: "#/definitions/Notification"
Run Code Online (Sandbox Code Playgroud)
swagger-codegen v2我使用以下配置生成代码(也尝试过 v3 和 openapi-generator):
<build>
<plugins>
<plugin>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>2.3.1</version>
<executions> …Run Code Online (Sandbox Code Playgroud) angular ×5
java ×4
ionic2 ×3
swagger ×2
typescript ×2
checkbox ×1
docker ×1
eclipse ×1
jetty ×1
jsp ×1
kotlin ×1
maven ×1
ng2-charts ×1
node-modules ×1
observable ×1
openapi ×1
openshift ×1
package.json ×1
rollup ×1
rxjs ×1
ssl ×1
svg ×1
systemjs ×1
unit-testing ×1