方法
hola() {
return new Promise((resolve, reject) => {
if(true) {
resolve(true)
}
})
}
Run Code Online (Sandbox Code Playgroud)
调用方法
this.hola.then(data => console.log(data));
Run Code Online (Sandbox Code Playgroud)
错误
类型“() => Promise<{}>”上不存在属性“then”。
我已经尝试重新启动离子服务,但它不断抛出该错误
我想在编辑时仅从我的表单发送编辑/更改的值。
目前,我的表单发送所有表单值。
我正在使用接口:
export interface WorkExperience {
id?: number;
name_company:string;
date_start:string;
date_end:string;
}
export interface WorkExperienceUpdate {
id_work_experience: number;
experience: WorkExperience;
}
Run Code Online (Sandbox Code Playgroud)
我在我的 .ts 上这样做:
经验:工作经验;
this.experience = this.navParams.get('experience');
this.registrationForm = formBuilder.group({
company: [this.experience.name_company, Validators.required],
date_start: [this.formatDate(this.experience.date_start), Validators.required],
date_end: [this.experience.date_end ? this.formatDate(this.experience.date_end) : '']
});
Run Code Online (Sandbox Code Playgroud)
我的 html 是:
<form [formGroup]="registrationForm">
<ion-item>
<ion-label floating>Company</ion-label>
<ion-input type="text" formControlName="company"></ion-input>
</ion-item>
<ion-label floating>Start Date</ion-label>
<ion-datetime displayFormat="DD-MM-YYYY" formControlName="date_start"></ion-datetime>
</ion-item>
<ion-item>
<ion-label floating>End Date</ion-label>
<ion-datetime displayFormat="DD-MM-YYYY" formControlName="date_end"></ion-datetime>
</ion-item>
</form>
Run Code Online (Sandbox Code Playgroud)
我使用相同的表单进行添加和编辑,因此在编辑时我只需要发送不相同的元素,如下所示:
{ "id_eduative_experience": …
我们正在构建一个仅在浏览器上提供服务的企业级应用程序(即它只是一个网络应用程序,而不是移动应用程序)。它也永远不会在移动应用程序中转换。
有人可以分享您的建议/经验,什么更适合用于开发。
1.) 使用 Ionic 框架
2.) 将 Angular ( https://angular.io ) 与 Angular Material ( https://material.angular.io/components/categories ) 一起使用
我们有 Ionic 的专业知识(在移动开发方面),如果我们使用 Ionic 会有什么缺点吗?
谢谢!
嗨,我是 Ionic 的新手,当我想创建新的加载屏幕时出现此错误。
Argument of type '{ content: string; }' is not assignable to parameter
of type 'LoadingOptions'.
Object literal may only specify known properties, and 'content' does not exist in type 'LoadingOptions'.
Run Code Online (Sandbox Code Playgroud)
我看到文档,我认为语法很好。
const loading = await this.loadingController.create({
content: 'Please wait...',
});
await loading.present();
Run Code Online (Sandbox Code Playgroud) 我想检查两个字段的值是否相同,这些字段必须通过参数传递给验证函数,我是这样做的,问题是获取不到字段的值,出现null,因为我可以正确动态地获取值吗?
我的表单构建器,我正在使用匹配功能来检查 cell_phone 和确认字段。
this.recharge = this.formBuilder.group({
cell_phone: ['', Validators.required, Validations.match('cell_phone', 'cell_phone_confirmation')],
cell_phone_confirmation: ['', [Validators.required]],
value: ['', Validators.required],
operator_id: ['', Validators.required]
});
Run Code Online (Sandbox Code Playgroud)
在我的函数中,控制台日志为空:
static match(field1: string, field2: string){
return (group: FormGroup) => {
console.log(group.get(field1));
}
}
Run Code Online (Sandbox Code Playgroud) 当我尝试使用import nativepagetransition提供程序时,它显示了一个错误。
import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
import { LinkPage } from '../pages/link/link';
import { NativePageTransitions } from '@ionic-native/native-page-transitions';
import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
@NgModule({
declarations: [
MyApp,
HomePage,
LinkPage,
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage,
LinkPage …Run Code Online (Sandbox Code Playgroud) 我正在使用ionic 3 ,我试图通过firebase将google plus 登录集成到我的应用程序中。但我收到错误,
错误是>>
ERROR TypeError: Object(...) is not a function
at GooglePlus.login (index.js:27)
at HomePage.webpackJsonp.186.HomePage.login (home.ts:28)
at Object.eval [as handleEvent] (HomePage.html:3)
at handleEvent (core.js:13589)
at callWithDebugContext (core.js:15098)
at Object.debugHandleEvent [as handleEvent] (core.js:14685)
at dispatchEvent (core.js:10004)
at core.js:10629
at HTMLButtonElement.<anonymous> (platform-browser.js:2628)
at t.invokeTask (polyfills.js:3)
I am putting code below which I have used for integrationg google plus Integration
Run Code Online (Sandbox Code Playgroud)
.ts 文件
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from …Run Code Online (Sandbox Code Playgroud) 在进行 android 构建时,我遇到了问题。
任务 ':app:transformDexArchiveWithExternalLibsDexMergerForDebug' 执行失败
任务 :CordovaLib:compileDebugShaders UP-TO-DATE 任务 :CordovaLib:generateDebugAssets UP-TO-DATE 任务 :CordovaLib:packageDebugAssets UP-TO-DATE 任务 :app:mergeDebugAssets 任务 :app:validateSigningDebug UP-TO-DATE 任务配置器 :app:signing最新任务 :app:transformClassesWithDexBuilderForDebug 最新任务
任务:app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED D8:程序类型已经存在:android.support.v4.os.ResultReceiver$MyResultReceiver
FAILURE:构建失败,出现异常。
出了什么问题:任务 ':app:transformDexArchiveWithExternalLibsDexMergerForDebug' 执行失败。
com.android.builder.dexing.DexArchiveMergerException:合并 dex 档案时出错:在https://developer.android.com/studio/build/dependencies#duplicate_classes了解如何解决该问题。程序类型已经存在:android.support.v4.os.ResultReceiver$MyResultReceiver
尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。使用 --scan 运行以获得完整的见解。
在https://help.gradle.org获取更多帮助
在 22 秒内构建失败 35 个可操作任务:3 个已执行,32 个最新 /Users/panmoh/Documents/mobile-app/platforms/android/gradlew:命令失败,退出代码 1 错误输出:D8:程序类型已存在: android.support.v4.os.ResultReceiver$MyResultReceiver
FAILURE:构建失败,出现异常。
出了什么问题:任务 ':app:transformDexArchiveWithExternalLibsDexMergerForDebug' 执行失败。
com.android.builder.dexing.DexArchiveMergerException:合并 dex 档案时出错:在https://developer.android.com/studio/build/dependencies#duplicate_classes了解如何解决该问题。程序类型已经存在:android.support.v4.os.ResultReceiver$MyResultReceiver
尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。使用 --scan 运行以获得完整的见解。
在https://help.gradle.org获取更多帮助 …
我知道ionic 3并且即将在 ionic.so 中开始一个新的项目应用程序,所以我是否应该继续使用ionic 3或者我可以使用ionic 4 。如果我将使用ionic 4那么我可以获得比ionic 3更多的功能。
嗨,我对 Angular 不是很有经验,也找不到解决方案 - 我正在做一个 Ionic Cordova 项目,我想更新 Android API 级别。在那之后,我无法使用命令构建我的代码
ionic cordova build --release android
> ionic-app-scripts.cmd build --target cordova --platform android
[14:39:13] ionic-app-scripts 3.2.4
[14:39:13] build dev started ...
[14:39:13] clean started ...
[14:39:13] clean finished in 18 ms
[14:39:13] copy started ...
[14:39:13] deeplinks started ...
[14:39:13] deeplinks finished in 337 ms
[14:39:13] transpile started ...
[14:39:20] typescript: {PROJECT_ROOT}/node_modules/@ionic/storage/index.d.ts, line: 5
Type 'ModuleWithProviders' is not generic.
L4: export declare class IonicStorageModule {
L5: static forRoot(storageConfig?: StorageConfig): ModuleWithProviders<IonicStorageModule>; …Run Code Online (Sandbox Code Playgroud) ionic3 ×10
angular ×6
cordova ×2
ionic2 ×2
android ×1
angularfire2 ×1
build ×1
ionic-native ×1
ionic4 ×1
node.js ×1
typescript ×1