我有一个屏幕上正在填充的项目列表,只想在列表视图中突出显示选中的项目/项目,请帮忙
<ion-list >
<button ion-item *ngFor="let route of Routes" (click)="selectCP(route)" >
{{route.Name}}
</button>
</ion-list>
Run Code Online (Sandbox Code Playgroud) 我试图在离子3上使用textMask,但它不起作用我收到错误信息(无法绑定到'textMask',因为它不是'ion-input'的已知属性).我正在关注Joshmorony的教程https://www.joshmorony.com/improve-mobile-form-ux-with-input-masks/
app.module.ts
import { TextMaskModule } from 'angular2-text-mask';
@NgModule({
imports: [
FormsModule,
TextMaskModule
],
contact.html
<ion-input type="tel"
[(ngModel)]="phoneNumber"
[textMask]="{mask: masks.phoneNumber}" >
</ion-input>
contact.ts
import { TextMaskModule } from 'angular2-text-mask';
export class ContactPage {
form: FormGroup;
masks: any;
phoneNumber: any = "";
constructor() {
this.masks = {
phoneNumber: ['(', /[1-9]/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/],
};
}
}
Run Code Online (Sandbox Code Playgroud) 对不起,我尝试用命令构建一个APK
ionic cordova build android --debug
FAILURE: Build failed with an exception.
Run Code Online (Sandbox Code Playgroud)
出了什么问题:无法解析配置':app:debugCompileClasspath'的所有文件.
找不到play-services-auth.aar(com.google.android.gms:play-services-auth:11.8.0).在以下位置搜索:https: //jcenter.bintray.com/com/google/android/gms/play-services-auth/11.8.0/play-services-auth-11.8.0.aar 无法找到播放 - services-identity.aar(com.google.android.gms:play-services-identity:11.8.0).在以下位置搜索:https: //jcenter.bintray.com/com/google/android/gms/play-services-identity/11.8.0/play-services-identity-11.8.0.aar找不到播放 - services-auth-api-phone.aar(com.google.android.gms:play-services-auth-api-phone:11.8.0).在以下位置搜索:https: //jcenter.bintray.com/com/google/android/gms/play-services-auth-api-phone/11.8.0/play-services-auth-api-phone-11.8. 0.aar 找不到play-services-auth-base.aar(com.google.android.gms:play-services-auth-base:11.8.0).在以下位置搜索:https: //jcenter.bintray.com/com/google/android/gms/play-services-auth-base/11.8.0/play-services-auth-base-11.8.0.aar 可以找不到play-services-identity-license.aar(com.google.android.gms:play-services-identity-license:11.8.0).在以下位置搜索:https: //jcenter.bintray.com/com/google/android/gms/play-services-identity-license/11.8.0/play-services-identity-license-11.8.0.aar 可以找不到play-services-auth-api-phone-license.aar(com.google.android.gms:play-services-auth-api-phone-license:11.8.0).在以下位置搜索:https: //jcenter.bintray.com/com/google/android/gms/play-services-auth-api-phone-license/11.8.0/play-services-auth-api-phone- license-11.8.0.aar 找不到play-services-auth-base-license.aar(com.google.android.gms:play-services-auth-base-license:11.8.0).在以下位置搜索:https: //jcenter.bintray.com/com/google/android/gms/play-services-auth-base-license/11.8.0/play-services-auth-base-license-11.8. 0.aar
尝试:使用--stacktrace选项运行以获取堆栈跟踪.使用--info或--debug选项运行以获取更多日志输出.
在https://help.gradle.org获取更多帮助
在13s中构建失败14个可操作的任务:1个执行,13个最新(节点:440)UnhandledPromiseRejectionWarning:错误:/ home/alain/PuntoPro/PuntoPro/platforms/android/gradlew:命令失败,退出代码1错误输出: FAILURE:构建因异常而失败.
出了什么问题:无法解析配置':app:debugCompileClasspath'的所有文件.
找不到play-services-auth.aar(com.google.android.gms:play-services-auth:11.8.0).在以下位置搜索:https: //jcenter.bintray.com/com/google/android/gms/play-services-auth/11.8.0/play-services-auth-11.8.0.aar 无法找到播放 - services-identity.aar(com.google.android.gms:play-services-identity:11.8.0).在以下位置搜索:https: //jcenter.bintray.com/com/google/android/gms/play-services-identity/11.8.0/play-services-identity-11.8.0.aar找不到播放 - services-auth-api-phone.aar(com.google.android.gms:play-services-auth-api-phone:11.8.0).在以下位置搜索:https: //jcenter.bintray.com/com/google/android/gms/play-services-auth-api-phone/11.8.0/play-services-auth-api-phone-11.8. 0.aar 找不到play-services-auth-base.aar(com.google.android.gms:play-services-auth-base:11.8.0).在以下位置搜索:https: //jcenter.bintray.com/com/google/android/gms/play-services-auth-base/11.8.0/play-services-auth-base-11.8.0.aar 可以找不到play-services-identity-license.aar(com.google.android.gms:play-services-identity-license:11.8.0).在以下位置搜索:https: //jcenter.bintray.com/com/google/android/gms/play-services-identity-license/11.8.0/play-services-identity-license-11.8.0.aar 可以找不到play-services-auth-api-phone-license.aar(com.google.android.gms:play-services-auth-api-phone-license:11.8.0).在以下位置搜索: …
我正在尝试在Ionic 4中使用Camera Plugin,当服务启动时没有错误,在浏览器控制台中出现此错误:
我删除文件夹node_modules并重新安装它,但无法解决此问题.
npm安装
使用ActionSheet我有同样的错误.
包中的依赖关系:
"dependencies": {
"@angular/common": "~6.1.1",
"@angular/core": "^6.1.2",
"@angular/forms": "~6.1.1",
"@angular/http": "~6.1.1",
"@angular/platform-browser": "^6.1.2",
"@angular/platform-browser-dynamic": "~6.1.1",
"@angular/router": "~6.1.1",
"@ionic-native/action-sheet": "^4.11.0",
"@ionic-native/camera": "^4.11.0",
"@ionic-native/core": "^5.0.0-beta.14",
"@ionic-native/file-transfer": "^4.11.0",
"@ionic-native/network": "^4.11.0",
"@ionic-native/splash-screen": "5.0.0-beta.14",
"@ionic-native/status-bar": "5.0.0-beta.14",
"@ionic/angular": "^4.0.0-beta.2",
"@ionic/lab": "^1.0.6",
"@ionic/ng-toolkit": "^1.0.6",
"@ionic/schematics-angular": "^1.0.0",
"cordova-android": "^7.1.1",
"cordova-android-support-gradle-release": "^1.4.4",
"cordova-ios": "4.5.5",
"cordova-plugin-actionsheet": "^2.3.3",
"cordova-plugin-camera": "^4.0.3",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-file": "^6.0.1",
"cordova-plugin-file-transfer": "^1.7.1",
"cordova-plugin-ionic-keyboard": "^2.1.2",
"cordova-plugin-ionic-webview": "^2.0.2",
"cordova-plugin-network-information": "^2.0.1",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-whitelist": "^1.3.3",
"core-js": "^2.5.3",
"promise-polyfill": "^8.0.0",
"rxjs": "^6.2.2",
"rxjs-compat": "^6.2.2",
"zone.js": …Run Code Online (Sandbox Code Playgroud) 我正在尝试开发一个离子型应用程序,该应用程序将作为pwa部署,我希望将其中嵌入YouTube视频并将其显示在网格中。我的Cloud Firestore对象提供了视频链接,其标题和简短描述。
现在的问题是,当我尝试在具有单个网址的离子应用程序中使用iframe时:
<iframe width="560" height="315" src="https://www.youtube.com/embed/6kqe2ICmTxc" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
Run Code Online (Sandbox Code Playgroud)
那么它就可以了,但是当我将它绑定到数据库的Video URL时,它就不起作用了。控制台显示URL不是安全的URL。
现在,我知道可以使用DomSanitizer对其进行修复,但是我不知道如何将其用于包含所需链接的对象数组。
我最近接手了一个Ionic项目,并致力于使其工作。该项目在设备上运行,但是我正在尝试使其也能在浏览器中工作。
我已将插件和依赖项更新到最新版本,但现在我陷在Chrome控制台中一个奇怪的javascript错误中。出现此错误后,设备上的应用程序在弹出屏幕后也只是白色。我猜这是相同的javascript错误。
然后,按照这个答案,我摆脱了错误,但是有了一个新的错误,我终生无法解决。找不到任何有相同问题的人。
这是我在运行“离子服务”时在控制台中看到的内容:
如果您知道会导致这种情况的原因,请提供帮助!如何摆脱这个错误,让应用程序运行?
编辑:我认为也许可以与app.module代码有关:
import { NgModule } from '@angular/core';
import { IonicApp, IonicModule } from 'ionic-angular';
import { IonicStorageModule } from '@ionic/storage';
import { LongPress } from '../components/long-press/long-press';
import { MyApp } from './app.components';
import { BrowserModule } from '@angular/platform-browser';
import { AboutPage } from '../pages/about/about';
import { AddSkypeUserPage } from '../pages/add-skype-user/add-skype-user';
import { ContactPage } from '../pages/contact/contact';
import { DagsVisningPage } from '../pages/dags-visning/dags-visning';
import { HomePage } from '../pages/home/home';
import { InnstillingerPage } …Run Code Online (Sandbox Code Playgroud) 我遵循了firebase为我的应用程序创建动态链接的文档。https://firebase.google.com/docs/auth/web/cordova
我的社交媒体登录功能(Google,Facebook等)已经集成到我的Firebase帐户中。基于我在这里阅读的内容:https : //github.com/firebase/firebaseui-web/issues/195
如果未在Firebase中设置动态链接,则Firebase社交媒体登录名可能不会重定向回应用程序。因此,我采用了这种解决方案,以便可以将其重定向回我的应用程序。
但是,它返回了一个错误,说:
Android Studio项目检测到配置文件res / values / facebookconnect.xml,请求在C:\ Users \ Kyle Louise Villar \ QuickEApp \ platforms \ android \ res \ values \ facebookconnect.xml中找不到更改,而忽略配置文件res / values / facebookconnect .xml请求在C:\ Users \ Kyle Louise Villar \ QuickEApp \ platforms \ android \ res \ values \ facebookconnect.xml中找不到更改,忽略了在Android上准备Firebase无法读取未定义的属性“清单”
我的密码
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.codelean.quicke" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>QuickEApp</name>
<description>An awesome Ionic/Cordova app.</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
<content src="index.html" />
<access origin="*" /> …Run Code Online (Sandbox Code Playgroud) 我有以下代码:
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Ionic 4 - Menu</title>
<link rel="stylesheet" href="https://unpkg.com/@ionic/core@4.0.0-beta.13/css/ionic.bundle.css" />
<script src="https://unpkg.com/@ionic/core@4.0.0-beta.13/dist/ionic.js"></script>
<script>
window.addEventListener('load', event => {
document.querySelector('.button_details').addEventListener('click', (event) => {
document.querySelector('.menu_main').toggle();
});
});
</script>
</head>
<body>
<ion-menu class="menu_main" side="start">
<ion-header>
<ion-toolbar color="secondary">
<ion-title>Left Menu</ion-title>
</ion-toolbar>
</ion-header>
<ion-content padding>
Hello World!
</ion-content>
</ion-menu>
<ion-menu-controller></ion-menu-controller>
<ion-card style="display:inline-block;width:300px">
<ion-card-header>
<ion-card-title>Hello World</ion-card-title>
</ion-card-header>
<div style="padding:10px 10px;text-align:right;">
<ion-button color="primary" class="button_details">Details</ion-button>
</div>
</ion-card>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
它工作正常,但有一个例外:页面加载时,控制台上出现以下错误:
Error: "Menu: must …Run Code Online (Sandbox Code Playgroud) 我的应用程序称为BookHeart。它是由Ionic3使用“ cordova-ios”:“ ^ 4.5.5”构建的。
当我运行“ ionic cordova build ios”时,出现错误报告:
> ionic-app-scripts build --target cordova --platform ios
[03:10:01] ionic-app-scripts 3.2.0
......
[03:10:21] lint finished in 852 ms
> cordova build ios
Building project: /Users/dc/bookheart/platforms/ios/BookHeart.xcworkspace
Configuration: Debug
Platform: device
User defaults from command line:
IDEArchivePathOverride = /Users/dc/bookheart/platforms/ios/BookHeart.xcarchive
Build settings from command line:
CONFIGURATION_BUILD_DIR = /Users/dc/bookheart/platforms/ios/build/device
SHARED_PRECOMPS_DIR = /Users/dc/bookheart/platforms/ios/build/sharedpch
Build settings from configuration file '/Users/dc/bookheart/platforms/ios/cordova/build-debug.xcconfig':
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES
CODE_SIGN_ENTITLEMENTS = $(PROJECT_DIR)/$(PROJECT_NAME)/Entitlements-$(CONFIGURATION).plist
CODE_SIGN_IDENTITY = iPhone Developer
ENABLE_BITCODE = NO
GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1
HEADER_SEARCH_PATHS = …Run Code Online (Sandbox Code Playgroud) 我正在尝试@ionic-native/http在Ionic 4应用程序中使用该模块。它是新的,正在尝试在home.page组件中使用它。但是我得到这个错误:
Uncaught Error: Unexpected value 'HTTP' imported by the module 'AppModule'. Please add a @NgModule annotation.
我尝试了很多事情,甚至使用@beta模块,也将import语句添加到app.module.ts了imports []数组中。
她是app.module.ts
...
import { HTTP } from '@ionic-native/http/ngx';
...
@NgModule({
declarations: [AppComponent],
entryComponents: [],
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule, HTTP],
...Run Code Online (Sandbox Code Playgroud)
这是home.page.ts文件
...
import { HTTP } from '@ionic-native/http/ngx';
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
constructor(private http: HTTP) {}
....
}Run Code Online (Sandbox Code Playgroud)
我想念什么?
大家晚上好。