我需要根据用户的角色显示侧边菜单项.所以我检查app.html是否页面(角色)等于登录角色.但它在登录后不显示菜单内的项目,但在使用浏览器刷新按钮刷新应用程序后,它会显示正确的项目.我想问题是离子是缓存菜单视图,如果它是如此,我如何刷新应用程序以显示新的菜单项.
每次我使用其他用户/角色登录时,它都会根据之前的用户/角色显示菜单.
app.component.ts
constructor() {
this.initializeApp();
this.pages = [
{ title: 'Home', component: 'HomePage', icon: 'home', role: 5 },
{ title: 'Profile', component: 'ProfilePage', icon: 'person', role: 5 },
{ title: 'Account', component: 'AccountPage', icon: 'home', role: 5 },
{ title: 'Search Employee', component: 'AtlasemployeehomePage', icon: 'home', role: 4 }
];
}
Run Code Online (Sandbox Code Playgroud)
app.html
<ion-list>
<div *ngFor="let p of pages">
<button menuClose ion-item *ngIf="p.role == role" (click)="openPage(p)">
<ion-icon name="{{p.icon}}" style="margin-right:10%"></ion-icon> {{p.title}}
</button>
</div>
<button menuClose ion-item (click)="presentLogout()">
<ion-icon name="log-out" style="margin-right:10%"></ion-icon> Logout …Run Code Online (Sandbox Code Playgroud) 我正在使用react-navigation 1.2.1,并且每当我将react-navigation更新到2.0.0时,每件事情都正常工作,它会产生以下错误.知道为什么一定要发生吗?
ReactNavigation.addNavigationHelpers不是一个函数.
import * as ReactNavigation from 'react-navigation';
render() {
const { dispatch, nav } = this.props;
const navigation = ReactNavigation.addNavigationHelpers({
dispatch,
state: nav,
addListener,
});
return <AppNavigation navigation={navigation} />;
}
//"react-navigation": "2.0.0",
//"react-native": "0.53.3",
//"redux": "^3.7.2"
Run Code Online (Sandbox Code Playgroud) 我正在尝试在 React Native 应用程序中实现视频通话功能。我使用过React Native twilio video webrtc。我已经实现了相同的功能并使其正常工作。
我不完全了解移动应用中视频通话的流程。我用于视频通话的流程如下:
现在我被困在第 5 点。我正在向user2发送 FCM 通知(显示在托盘中(编辑:现在使用 voip notif),现在我需要在 user2 的移动设备上显示振铃 UI,即使应用程序被杀死并且电话是锁定。我怎样才能做到这一点?
我想有一个名为react-native-callkit的包,我应该将它与PushKit一起使用。但问题在于android流程。android 不支持 PushKit 和 CallKit。因此,当应用程序处于终止状态时,通知出现我需要抓住控件并显示响铃 UI,如果手机被锁定并且应用程序被终止,则唤醒屏幕。
一些困惑
是否有任何特殊类型的推送通知不会显示在托盘中?(编辑:我猜是数据消息和 VOIP 通知)
除了react-native-callkit(用于显示振铃 UI)之外,还有其他包可以用于 android 和 ios 吗?
我有两个导航器,一个是stackNavigator,另一个是抽屉导航器。我要执行的操作是分派操作并成功登录,然后将用户重定向到抽屉式导航器。我已经使用了反应导航。我所做的是,我正在传奇中分派动作登录成功。使用NavigationActions.navigate({ routeName: 'drawerStack' })派遣行动。该动作成功分派,但没有导航到抽屉导航器,如下图所示。我究竟做错了什么?
saga.js
function* watchLoginRequest() {
while (true) {
const { state } = yield take(LOGIN_REQUEST);
try {
const payload = {
state
};
const response = yield call(loginCall, payload);
yield put(loginSuccess(response));
yield setUser(response.user);
yield put(NavigationActions.navigate({ routeName: 'drawerStack' }));
} catch (err) {
yield put(loginFailure(err.status));
}
}
}
Run Code Online (Sandbox Code Playgroud)
cabinetNavigation.js
// drawer stack
const DrawerStack = DrawerNavigator({
testComponent: { screen: TestComponent },
});
const DrawerNav = StackNavigator({
drawerStack: { screen: DrawerStack }
}, {
headerMode: 'float',
navigationOptions: …Run Code Online (Sandbox Code Playgroud) reactjs react-native redux-saga react-redux react-navigation
嗨,我正在尝试着重于搜索输入字段。我已经为此创建了一个指令。它已从directives.module.ts中导出。另外,我将指令。模块导入到app.module.ts中。每当我尝试在ion-searchbar中使用指令时,都会出现以下错误。我不知道我在想什么。
Can't bind to 'focuser' since it isn't a known property of 'ion-searchbar'.
Run Code Online (Sandbox Code Playgroud)
指令.module.ts
import { NgModule } from '@angular/core';
import { FocuserDirective } from './focuser/focuser';
@NgModule({
declarations: [FocuserDirective],
imports: [],
exports: [FocuserDirective]
})
export class DirectivesModule {}
Run Code Online (Sandbox Code Playgroud)
聚焦器
import {Directive, Renderer, ElementRef} from "@angular/core";
/**
* Generated class for the FocuserDirective directive.
*
* See https://angular.io/api/core/Directive for more info on Angular
* Directives.
*/
@Directive({
selector: '[focuser]' // Attribute selector
})
export class FocuserDirective {
constructor(public renderer: Renderer, public …Run Code Online (Sandbox Code Playgroud) typescript ionic-framework angular2-directives ionic3 angular
我在构建我的离子3应用程序时遇到了麻烦.每次我尝试构建Android应用程序时都会出现以下错误.
* What went wrong:
Execution failed for task ':processDebugManifest'.
> Manifest merger failed : Attribute meta-data#android.support.VERSION@value val
ue=(25.3.1) from [com.android.support:appcompat-v7:25.3.1] AndroidManifest.xml:2
7:9-31
is also present at [com.android.support:support-v4:26.0.0-alpha1] Androi
dManifest.xml:27:9-38 value=(26.0.0-alpha1).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element a
t AndroidManifest.xml:25:5-27:34 to override.
Run Code Online (Sandbox Code Playgroud)
我的离子信息如下:
cli包:(C:\ Users\SystemOne\AppData\Roaming \npm \node_modules)
@ionic/cli-utils : 1.18.0
ionic (Ionic CLI) : 3.18.0
Run Code Online (Sandbox Code Playgroud)
全球套餐:
cordova (Cordova CLI) : 6.5.0
Run Code Online (Sandbox Code Playgroud)
本地包裹:
@ionic/app-scripts : 3.0.0
Cordova Platforms : none
Ionic Framework : ionic-angular 3.7.1
Run Code Online (Sandbox Code Playgroud)
系统:
Node : v6.10.0
npm : …Run Code Online (Sandbox Code Playgroud) 我按照下面的链接创建了一个Android虚拟设备(AVD)。
https://developer.android.com/studio/run/managing-avds.html
一旦我单击完成按钮,就会出现以下错误:
创建AVD时发生错误。有关详细信息,请参见idea.log。如我所见,最后一行给出了访问被拒绝的错误。是否需要对.android文件夹的权限?当我尝试授予.android文件夹权限时,它不允许我使用。它说
chmod:无法访问“ 777”:没有此类文件或目录
idea.log文件的最后几行是
idea.log
2018-01-11 13:00:17,173 [d thread 4] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 86ms; general responsiveness: ok; EDT responsiveness: ok
2018-01-11 13:00:18,629 [d thread 1] INFO - .script.IdeScriptEngineManager - javax.script.ScriptEngineManager initialized in 72 ms
2018-01-11 13:00:19,672 [se-915-b01] INFO - pl.ProjectRootManagerComponent - project roots have changed
2018-01-11 13:00:19,706 [d thread 2] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 2ms; general responsiveness: ok; EDT responsiveness: ok
2018-01-11 13:00:19,766 [d thread 2] INFO - .diagnostic.PerformanceWatcher …Run Code Online (Sandbox Code Playgroud) android android-virtual-device react-native ubuntu-16.04 avd-manager
我正在尝试实现一个本机模块,该模块在react native中提供连接服务。但是我面临一个错误。由于我不是一名android / java开发人员,因此无法找到以下错误的原因。
E:\projects\deets-mobile-cp\node_modules\react-native-connection-service\android\src\main\java\com\genm\CallConnection.java:10: error: cannot find symbol
@TargetApi(Build.VERSION_CODES.O_MR1)
^
symbol: variable O_MR1
location: class VERSION_CODES
E:\projects\deets-mobile-cp\node_modules\react-native-connection-service\android\src\main\java\com\genm\CallConnection.java:14: error: cannot find symbol
setConnectionProperties(PROPERTY_SELF_MANAGED);
^
symbol: variable PROPERTY_SELF_MANAGED
location: class CallConnection
Run Code Online (Sandbox Code Playgroud)
CallConnection.java
package com.genm;
import android.annotation.TargetApi;
import android.os.Build;
import android.telecom.Connection;
import android.util.Log;
import static android.content.ContentValues.TAG;
@TargetApi(Build.VERSION_CODES.O_MR1)
public class CallConnection extends Connection{
public CallConnection(){
setConnectionProperties(PROPERTY_SELF_MANAGED);
setAudioModeIsVoip(true);
}
@Override
public void onAnswer(){
Log.d(TAG, "On answer to the call");
}
}
Run Code Online (Sandbox Code Playgroud) 我刚开始就陷入困境。我已经安装了laravel,当我运行php artisan serv命令时,会出现此(Laravel开发服务器在http:// localhost:8000 /上启动)行,但是当我通过浏览器(http:// localhost:8000 /)访问它时显示以下错误。
禁止访问!您无权访问所请求的对象。服务器对其进行了读保护或不可读。如果您认为这是服务器错误,请与网站管理员联系。错误403本地主机Apache / 2.4.18(Win32)OpenSSL / 1.0.2e PHP / 7.0.2
请帮帮我。任何帮助将不胜感激。我是Laravel的初学者。
我在数据表中显示图像时遇到问题.下面的代码在列的一侧显示整个html(HTML没有呈现).它曾经与laravel 5.3及以下版本一起使用.如何使用laravel 5.4.谢谢.
$data = Member::query()
->get();
return Datatables::of($data)
->addColumn('picture', function ($data) {
return '<img src=" '.$data->picture.' "/>';
})
->make(true);
Run Code Online (Sandbox Code Playgroud) react-native ×5
android ×3
angular ×3
ionic3 ×3
ionic2 ×2
reactjs ×2
typescript ×2
apache ×1
artisan ×1
avd-manager ×1
cordova ×1
ios ×1
laravel ×1
laravel-5.4 ×1
php ×1
react-redux ×1
redux ×1
redux-saga ×1
twilio ×1
ubuntu-16.04 ×1
webrtc ×1
xampp ×1