错误错误:没有Facebook提供商!
 at injectionError(core.es5.js:1231)
 at noProviderError(core.es5.js:1269)
 at ReflectiveInjector_.throwOrNull(core.es5.js:2770)
 at ReflectiveInjector.getByKeyDefault(core.es5.js:2809)
 at ReflectiveInjector.getByKey(core.es5.js:2741)
 at ReflectiveInjector获得(core.es5.js:2610)
 at AppModuleInjector.NgModuleInjector.get(core.es5.js:3578)
 at resolveDep(core.es5.js:11039)
 at createClass(core.es5.js:10903)
at createDirectiveInstance(core.es5.js:10723)
View_MyApp_Host_0 @ MyApp_Host.html:1
在我单击离子应用键盘中的“发送”按钮后,它被隐藏了。我的代码:
<ion-item>
<ion-labe>Text</ion-label>
<ion-textarea [(ngModel)]="text" placeholder="Write a Message …"></ion-textarea>
</ion-item>
<a (click)="sendMessage();">Send</a>
Run Code Online (Sandbox Code Playgroud)
单击操作后,我需要键盘保持打开状态。请帮帮我。
我正在尝试使用ionic / file-chooser插件来上传文件。一切都很完美,直到我没有要求上传doc或pdf文件。我正在使用离子3.12.0和科尔多瓦7.0.1。
const fileTransfer: FileTransferObject = this.transfer.create();
let options: FileUploadOptions = {
fileKey: 'files0',
fileName: 'name.jpg',
params: {
Authkey: this.CS.auth_key,
Token: this.CS.token,
group_id: this.CS.activeGroupId,
Userid: this.CS.userId
}
};
this.fileChooser.open()
.then(uri => {
this.CS.show_loader();
//alert(uri );
this.file.resolveLocalFilesystemUrl(uri)
.then((files)=> {
alert(JSON.stringify(files, null, 4));
}).catch((err) => {
alert(JSON.stringify(err, null, 4));
});
//let name = uri.split("/");
//options.fileName = name[name.length - 1];
// alert(options.fileName);
fileTransfer.upload(uri, this.CS.base_url + 'groups/uploadChat', options)
.then((data) => {
this.CS.hide_loader();
this.res = data;
//alert(JSON.stringify(data, null, 4));
let d = JSON.parse(this.res.response);
if(d.status …Run Code Online (Sandbox Code Playgroud) 我在离子3暂停和恢复事件中面临奇怪的问题,每当我暂停应用程序时,事件多次调用(一次2次,一次3次等).这是代码
this.platform.ready().then(() => {
this.platform.pause.subscribe(() => {
console.log('****UserdashboardPage PAUSED****');
});
this.platform.resume.subscribe(() => {
console.log('****UserdashboardPage RESUMED****');
});
});
Run Code Online (Sandbox Code Playgroud)
我试过在ionViewDidLoad中放置相同的代码,构造函数,ionViewWillEnter仍面临同样的问题.请有人帮我解决这个问题.一旦应用程序恢复,我正在调用一个服务,但现在它已多次调用.谢谢!
ionic 3,我已经成功实现了动态选择选项,我希望能够将所选到Option的ID值和Name值发送到服务器
因为我只能获得 ID 或名称,所以我无法获得两个值,请帮忙,我已经尝试了 JSON.parse,以及选项中的 id.value 和 name.value,但遗憾的是我是只能获得第一个值,不能同时获得
<ion-list >
<ion-item class="list-but">
<ion-label>Tipo de Ambiente</ion-label>
<ion-select
[(ngModel)]="idType"
multiple="false"
cancelText="Cancelar"
okText="Ok"
>
<ion-option
*ngFor="let type of type_environment"
value="{{ type.name }}"
value="{{ type.id }}"
#name
>{{ type.name }}</ion-option
>
</ion-select>
</ion-item>
</ion-list>
<button ion-button block (click)="insert()">Salvar</button>
``public type_environment = new Array<any>();
public idType: number = 0;
public nameType: string = "name";
private userData: any;`
```
insert() {
this.userData = this.user.getUserData();
let body = {
name: this.nameType,
id_type: this.idType,
id_unity: this.navParams.get("id.unidade")
}; …Run Code Online (Sandbox Code Playgroud) 我在Ionic 3应用程序中使用了离子本机linkedin插件.
我的代码:
var scopes = ['r_basicprofile', 'r_emailaddress', 'rw_company_admin', 'w_share'];
this.linkedin.login(scopes, true).then((res) => {
console.log(res) ;
}, (err) => {
console.log(err) ;
});
Run Code Online (Sandbox Code Playgroud)
我有错误:
'string []'类型的参数不能分配给'LinkedInLoginScopes []'类型的参数.类型'string'不能分配给'LinkedInLoginScopes'类型.
请帮帮我.
我正在为壁纸构建一个离子应用程序.
在应用程序中,存在显示在www/assets/img中的图像.我在下面构建了2个按钮,用于下载和检索显示的图像到移动设备存储器.
当我点击下载按钮时,会出现一个对话框,说"下载成功!Pug.jpg已成功下载到:filepath".但是当我检查手机内存时没有这样的文件.当我点击"检索"按钮时它会显示对话框说"文件检索成功!Pug.jpg已成功检索:filepath""即使手机内存中没有文件.
这是home.ts代码
import {Component} from '@angular/core';
import {NavController, Platform, AlertController} from 'ionic-angular';
import {Transfer, TransferObject} from '@ionic-native/transfer';
import {File} from '@ionic-native/file';
declare var cordova: any;
@Component({
selector: 'page-home',
templateUrl: 'home.html',
providers: [Transfer, TransferObject, File]
})
export class HomePage {
storageDirectory: string = '';
constructor(public navCtrl: NavController, public platform: Platform, private transfer: Transfer, private file: File, public alertCtrl: AlertController) {
this.platform.ready().then(() => {
// make sure this is on a device, not an emulation (e.g. chrome tools device mode) …Run Code Online (Sandbox Code Playgroud) 我正在尝试实施https://ionicframework.com/docs/native/file-transfer/
因此我需要安装https://ionicframework.com/docs/native/file/
当我在我的服务中使用"文件"时,我收到错误:
无法解析File的所有参数:(?,?,?,?,?).
我知道问号可能类似于循环引用,我从来没有在其他任何地方使用我的服务,也没有使用过"文件".
import {Injectable} from '@angular/core';
import {File} from "@ionic-native/file";
import { FileTransfer, FileTransferObject } from '@ionic-native/file-transfer';
@Injectable()
export class ImageService {
constructor(private file: File, private transfer: FileTransfer) {
}
public getImagesOfSchedule() {
const fileTransfer: FileTransferObject = this.transfer.create();
const url = 'http://techbooster.be/wp-content/uploads/2017/11/logo-long-white.png';
fileTransfer.download(url, this.file.dataDirectory + 'file.pdf').then((entry) => {
console.log('download complete: ' + entry.toURL());
}, (error) => {
// handle error
});
}
}
Run Code Online (Sandbox Code Playgroud)
app.module.ts
providers: [
StatusBar,
AuthenticationService,
ScheduleService,
ToastService,
StorageService,
FacebookService,
GoogleService,
ImageService,
Facebook, …Run Code Online (Sandbox Code Playgroud) 我正在使用 ionic CLI 版本 4.12.0 创建应用程序,当我使用此命令ionic Cordova platform add ios
ionic CLI 添加我的应用程序的 Xcode 文件时,但是当我在真实设备上运行该应用程序时,我收到此错误
ERROR: Start Page at 'www/index.html' was not found。和
Internal navigation rejected - <allow-navigation> not set for url='about:blank'
Run Code Online (Sandbox Code Playgroud)
我认为我的 ionic CLI 不会像 ionic3 CLI 那样生成 www 文件夹文件,是否缺少某些内容。www 文件夹完全是空的,并且未显示在 Xcode 文件中
ionic-native ×10
ionic3 ×5
angular ×4
cordova ×3
ionic2 ×3
typescript ×3
android ×2
ionic4 ×2
file ×1
file-upload ×1
ios ×1
xcode ×1