我正在使用Ionic 2来开发我的应用程序.我想在我的应用程序中使用我的自定义图标,就像我们使用离子2图标一样标签.例如:
<ion-icon name="my-custom-icon"></ion-icon>
Run Code Online (Sandbox Code Playgroud)
我怎样才能实现这一目标?有没有推荐的方法来做到这一点?
我正在为类似于以下示例的方法编写JUnit测试用例:
Class SampleA{
public static void methodA(){
boolean isSuccessful = methodB();
if(isSuccessful){
SampleB.methodC();
}
}
public static boolean methodB(){
//some logic
return true;
}
}
Class SampleB{
public static void methodC(){
return;
}
}
Run Code Online (Sandbox Code Playgroud)
我在我的测试类中编写了以下测试用例:
@Test
public void testMethodA_1(){
PowerMockito.mockStatic(SampleA.class,SampleB.class);
PowerMockito.when(SampleA.methodB()).thenReturn(true);
PowerMockito.doNothing().when(SampleB.class,"methodC");
PowerMockito.doCallRealMethod().when(SampleA.class,"methodA");
SampleA.methodA();
}
Run Code Online (Sandbox Code Playgroud)
现在我想验证是否调用类Sample B的静态methodC().如何使用PowerMockito 1.6实现?我尝试了很多东西,但似乎并没有为我做好准备.任何帮助表示赞赏.
我在Ionic 2中创建了一个按钮,如下所示:
<button secondary block round padding style="text-align : left;">
<ion-icon ios="ios-key" md="md-key"></ion-icon>
Login
</button>
Run Code Online (Sandbox Code Playgroud)
我试图将按钮文本对齐到左侧,但它不会到那里.有没有可用于实现这一目标?
我正在尝试设置 Application Load Balancer 以将流量转发到 AWS 中的 Nginx Ingress 控制器。为了设置 Nginx Ingress 控制器,我使用了这个YML,它是从安装说明中得到的。
部署后,一切正常,流量正确转发到 EKS Pod。但是,上面的 YML 文件正在aws 中创建“ Classic Load Balancer ”,因为我想创建“ Application Load Balancer ”。我将“ service.beta.kubernetes.io/aws-load-balancer-type: elb ”更改为“ service.beta.kubernetes.io/aws-load-balancer-type: alb ”但它仍然在创建经典负载均衡器亚马逊。
请帮助设置所需的 LB。提前致谢。
nginx amazon-web-services kubernetes kubernetes-ingress nginx-ingress
可以说我有以下列表:
<ion-list radio-group [(ngModel)]="autoManufacturers">
<ion-list-header>
Auto Manufacturers
</ion-list-header>
<ion-item>
<ion-label>Cord</ion-label>
<ion-radio value="cord"></ion-radio>
</ion-item>
<ion-item>
<ion-label>Duesenberg</ion-label>
<ion-radio value="duesenberg"></ion-radio>
</ion-item>
<ion-item>
<ion-label>Hudson</ion-label>
<ion-radio value="hudson"></ion-radio>
</ion-item>
</ion-list>
Run Code Online (Sandbox Code Playgroud)
根据我从数据库中获得的值,我想检查列表中的项目.让我们说如果我得到值'cord',那么第2项应显示为所选项目.如何使用TypeScript实现此目的?
如何在带有MobileFirst V8.0的Cordova 6.3中的config.xml中为iOS注册不同的Bundle Identifier(不同于id属性中指定的标识符)。
我的config.xml定义如下:
<widget android-versionCode="10" id="com.example.androidpackage" ios-CFBundleIdentifier="com.example.iospackage" ios-CFBundleVersion="1.5" version="3.7" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:mfp="http://www.ibm.com/mobilefirst/cordova-plugin-mfp">
Run Code Online (Sandbox Code Playgroud)
如果我使用上面的小部件添加平台,则我将获得捆绑包标识符为“ com.example.iospackage”的iOS项目,但是当我在cordova prepare使用mfpdev app register命令执行完注册应用程序后,便会在“ com.example”中注册该应用程序。 androidpackage”(适用于Android和iOS平台)。我该如何在MobileFirst Platform V8.0中进行操作?
当我尝试导出应用程序时,我的基于 IBM MobileFirst 8 的混合 Cordova 6.5 应用程序出现以下错误:
2017-02-24 21:54:40 +0000 [MT] Failed to generate distribution items with error: Error Domain=DVTMachOErrorDomain Code=0 "Found an unexpected Mach-O header code: 0x72613c21" UserInfo={NSLocalizedDescription=Found an unexpected Mach-O header code: 0x72613c21, NSLocalizedRecoverySuggestion=}
2017-02-24 21:54:40 +0000 [MT] Presenting: Error Domain=DVTMachOErrorDomain Code=0 "Found an unexpected Mach-O header code: 0x72613c21" UserInfo={NSLocalizedDescription=Found an unexpected Mach-O header code: 0x72613c21, NSLocalizedRecoverySuggestion=}
2017-02-24 22:05:30 +0000 [MT] Beginning distribution assistant for archive: App Name, task: Validate
2017-02-24 22:05:30 +0000 [MT] Automatically selecting the …Run Code Online (Sandbox Code Playgroud) 我所知道的描述,我们可以通过执行下面的数据传递到从父标签的子标签在这里:
<ion-tabs>
<ion-tab [root]="chatRoot" [rootParams]="chatParams" tabTitle="Chat" tabIcon="chat"><ion-tab>
</ion-tabs>
Run Code Online (Sandbox Code Playgroud)
有什么方法可以做反向的东西,即将数据从子选项卡传递到父选项卡.
我有以下场景:1.我在Tabs(父)页面上有"下一步"按钮.2.当用户选择子页面上的值时,我需要在用户单击下一步时根据所选值将用户导航到下一页.
我在由IBM MobileFirst Platform 8.0(mfpdev verion 8.0.0-2016070716)Beta 提供支持的Ionic 2(v 2.0.0-beta.32)应用程序中创建了一个提供程序.以下是代码:
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
@Injectable()
export class EmployeeService {
data: any;
constructor() {
this.data = null;
}
load() {
console.log('--> called employee service');
if (this.data) {
// already loaded data
return Promise.resolve(this.data);
}
// don't have the data yet
return new Promise(resolve => {
let dataRequest = new WLResourceRequest("/adapters/messangerAdapter/getEmployeeRating",WLResourceRequest.GET);
/*dataRequest.send().then((response) => {
console.log('--> adapter response recieved', response.responseJSON.results);
this.data = …Run Code Online (Sandbox Code Playgroud) 我想将现有代码从JMS1.1迁移到JMS 2.0.我正在使用Java 8通过WebSphere Liberty Profile 16.0部署应用程序.当我wasJmsClient-2.0在server.xml中启用功能时,我收到以下错误:
['wasJmsClient-2.0' --> 'com.ibm.websphere.appserver.internal.jms-2.0' --> 'com.ibm.websphere.appserver.javax.connector.internal-1.7'] and ['ejbLite-3.1' --> 'com.ibm.websphere.appserver.transaction-1.1' -->
'com.ibm.websphere.appserver.javax.connector.internal-1.6'] features are in conflict. Select a compatible set of features.
Run Code Online (Sandbox Code Playgroud)
我如何知道哪些功能兼容哪些功能不兼容?
我正在为我的应用程序构建推送通知,但是当我在设备上运行我的应用程序时,我收到以下错误:
vendor-es2015.js:101693 Native: tried calling FCM.getToken, but the FCM plugin is not installed.
pluginWarn @ vendor-es2015.js:101693
vendor-es2015.js:101699 Install the FCM plugin: 'ionic cordova plugin add cordova-plugin-fcm-with-dependecy-updated'
pluginWarn @ vendor-es2015.js:101699
vendor-es2015.js:101693 Native: tried calling FCM.onNotification, but the FCM plugin is not installed.
pluginWarn @ vendor-es2015.js:101693
vendor-es2015.js:101699 Install the FCM plugin: 'ionic cordova plugin add cordova-plugin-fcm-with-dependecy-updated'
pluginWarn @ vendor-es2015.js:101699
vendor-es2015.js:101693 Native: tried calling FCM.onTokenRefresh, but the FCM plugin is not installed.
pluginWarn @ vendor-es2015.js:101693
vendor-es2015.js:101699 Install the FCM plugin: 'ionic cordova plugin …Run Code Online (Sandbox Code Playgroud) 我在MFP V8.0中编写了一个适配器程序.通过安全检查确保此过程.我想在调用此适配器过程之前检查用户是否已登录:
过程映射到范围如下:
<procedure name="searchData" scope="restrictedResource"/>
Run Code Online (Sandbox Code Playgroud)
安全检查定义如下:
<securityCheckDefinition name="UserValidationSecurityCheck" class="com.sample.UserValidationSecurityCheck">
Run Code Online (Sandbox Code Playgroud)
我也完成了服务器的Scope Element映射.
我写了下面调用适配器方法的方法:
function callAdapterProcedure(invocationData){
var procedureName = invocationData.procedure;
var successHandler = invocationData.successHandler;
var failureHandler = invocationData.failureHandler;
var parameters = invocationData.parameters;
var isuserLoggedIn = checkForLoggedInUser();
alert('is logged in' + isuserLoggedIn);
if(isuserLoggedIn){
var dataRequest = new WLResourceRequest(getAdapterPath(procedureName), WLResourceRequest.GET);
dataRequest.setQueryParameter("params", [JSON.stringify(parameters)]);
dataRequest.send().then(successHandler,failureHandler);
}else{
hideProgressBar();
showAlert(Messages.ALERT_SESSION_TIME_OUT);
logoutWithoutConfirmation();
openLogin();
}
}
Run Code Online (Sandbox Code Playgroud)
以下是checkForLoggedInUser()方法的实现:
function checkForLoggedInUser(){
var userAlreadyLoggedIn = undefined;//WL.Client.isUserAuthenticated(mrmGlobal.realms.authenticationRealm,null);
WLAuthorizationManager.obtainAccessToken("restrictedResource").then(
function (accessToken) {
alert("obtainAccessToken onSuccess");
userAlreadyLoggedIn = true;
},
function (response) {
alert("obtainAccessToken …Run Code Online (Sandbox Code Playgroud) ionic2 ×5
cordova ×4
angular ×2
ionic-native ×1
ionic3 ×1
ionic5 ×1
ios ×1
java ×1
junit4 ×1
kubernetes ×1
mockito ×1
nginx ×1
powermock ×1
powermockito ×1
typescript ×1
websphere ×1
websphere-8 ×1
xcode ×1
xcode8 ×1