如何使用fontawesome用ionic 2的,我下面这个教程,但它不工作.
我希望用户能够选择文本内容(在离子2中),以便他们可以复制它并将其粘贴到其他地方,但似乎已禁用文本选择.用户可以选择输入或文本区域中的文本,但我希望他们能够选择常规内容文本.有没有办法重新启用文本选择?
我有一个Ionic2我想添加的应用程序GooglePlus Authentication.
我收到以下错误:
据我了解,这是因为我没有设置redirect_uri.
题
我应该用什么redirect_uri(Authorized redirect URIs)用于Ionic2应用程序?我在哪里找到它?
以下适用于Facebook登录.
UPDATE
按照这些说明,我将其更改REVERSED_CLIENT_ID为以下格式:
"com.googleusercontent.apps.uniqueId"
Run Code Online (Sandbox Code Playgroud)
所以我认为我已经取得了进展.
我现在得到以下错误iOS:
从这里阅读,这意味着credentials不应该为Web Application 这里创建.但是,如果我创建它iOS,它将如何工作Android?或者还Android没有使用这些凭据?
因为Android,当我尝试登录时,我只是得到一个undefined错误消息的异常.
所以我有两个问题:
iOS 客户端ID 而不是?Web applicationAndroid?UPDATE
因为iOS我添加了一个iOS Client Id并更改了我的REVERSED CLIENT ID以匹配,并且喜欢Android,它促使我登录我的Google帐户.这看起来像是进一步的进展.
但是,一旦我登录,就像Android …
我正在构建一个离子2应用程序,我正在使用以下组件
http://ionicframework.com/docs/components/#alert
import { AlertController } from 'ionic-angular';
export class MyPage {
constructor(public alertCtrl: AlertController) {
}
showAlert() {
let alert = this.alertCtrl.create({
title: 'New Friend!',
subTitle: 'Your friend, Obi wan Kenobi, just accepted your friend request!',
buttons: ['OK']
});
alert.present();
}
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能确保当我在框外点击警报时不会被解雇?
我试图将我在https://github.com/bevacqua/dragula/issues/289#issuecomment-277143172上找到的代码用于我的Ionic项目.
当我运行代码时,我得到一个错误Cannot find namespace 'NodeJS',错误引用touchTimeout: NodeJS.Timer;
如何调整下面的代码以使NodeJS.Timer线路正常工作?
import { Directive, ElementRef, HostListener } from '@angular/core';
@Directive({ selector: '[delayDragLift]' })
export class DelayDragLiftDirective {
dragDelay: number = 200; // milliseconds
draggable: boolean = false;
touchTimeout: NodeJS.Timer;
@HostListener('touchmove', ['$event'])
// @HostListener('mousemove', ['$event'])
onMove(e: Event) {
if (!this.draggable) {
e.stopPropagation();
clearTimeout(this.touchTimeout);
}
}
@HostListener('touchstart', ['$event'])
// @HostListener('mousedown', ['$event'])
onDown(e: Event) {
this.touchTimeout = setTimeout(() => {
this.draggable = true;
}, this.dragDelay);
}
@HostListener('touchend', ['$event'])
// @HostListener('mouseup', …Run Code Online (Sandbox Code Playgroud) html的
<offline-picks *ngFor="let pick of pickData" [data]="pick"></offline-picks>
Run Code Online (Sandbox Code Playgroud)
.TS
export class OfflineArticlesPage {
private pickData: picksModel[] = [];
constructor(private localCacheService: LocalCacheServiceProvider) {
}
}
Run Code Online (Sandbox Code Playgroud)
当我使用private member如上所示时,它显示下面的错误.我在编辑器上使用Angular Language Service扩展VS code.
[Angular]标识符'pickData'指的是组件的私有成员
希望private members在组件内部使用是不是很好的编程习惯?但作为上述问题的解决方案,如下面对扩展的回购评论.
语言服务将发出这些错误,因为它们在AOT期间会出错.最终,您需要解决这些问题.
我们计划支持AOT中私人和受保护成员的访问,但至少在6.0(明年春天)之前不会降落.
那么你能告诉我在组件上声明成员的最佳方法是什么?
更新:
我使用ionic cordova run android --prod --deviceCLI命令和最新的Ionic "ionic-angular": "3.5.3",.但它在我的Android设备上运行良好.这意味着它工作得很好,AOT太没了?那为什么会出现这个错误(或实际警告)?
嗨我有一个功能,它会在http请求到服务器后更新.似乎console.log显示该值已更新但UI未更新,除非我单击任何其他组件(例如输入).
这是我的功能:
fileTransfer.upload(this.created_image, upload_url, options)
.then((data) => {
console.log("success:"+data.response); //This is showing correct response
var obj = JSON.parse(data.response);
this.sv_value = obj.value;
console.log(this.sv_value); //This is showing correct value
}, (err) => {
console.log("failure:");
})
Run Code Online (Sandbox Code Playgroud)
这是我的观点html:
<ion-row>
<ion-col center width-100 no-padding>
<h2>{{sv_value}}</h2> //This is not updated
</ion-col>
</ion-row>
Run Code Online (Sandbox Code Playgroud)
有什么办法可以解决这个问题吗?谢谢
更新到IOS 11后,命令
离子cordova运行ios -lc --target ="iPhone-6"
我有错误
**建立成功**
没有为"iPhone 6"找到可用的运行时.[错误]运行cordova run ios时发生错误 - 目标iPhone-6(退出代码1).
模拟器在命令后列出
ios-sim showdevicetypes
Apple-TV-1080p, tvOS 11.0
Apple-TV-4K-4K, tvOS 11.0
Apple-TV-4K-1080p, tvOS 11.0
Apple-Watch-38mm, watchOS 4.0
Apple-Watch-42mm, watchOS 4.0
Apple-Watch-Series-2-38mm, watchOS 4.0
Apple-Watch-Series-2-42mm, watchOS 4.0
Apple-Watch-Series-3-38mm, watchOS 4.0
Apple-Watch-Series-3-42mm, watchOS 4.0
iPhone-5s, 11.0
iPhone-6, 11.0
iPhone-6-Plus, 11.0
iPhone-6s, 11.0
iPhone-6s-Plus, 11.0
iPhone-7, 11.0
iPhone-7-Plus, 11.0
iPhone-SE, 11.0
iPhone-8, 11.0
iPhone-8-Plus, 11.0
iPhone-X, 11.0
iPad-Air, 11.0
iPad-Air-2, 11.0
iPad--5th-generation-, 11.0
iPad-Pro--9-7-inch-, 11.0
iPad-Pro, 11.0
iPad-Pro--12-9-inch---2nd-generation-, 11.0
iPad-Pro--10-5-inch-, 11.0 …Run Code Online (Sandbox Code Playgroud) 我正在使用离子2.
我需要获取HTML元素值.
实际上,我使用了viewchild.
这是我的html模板代码
<div class="messagesholder" *ngFor="let chat of chatval | orderby:'[date]'; let last = last">
{{last ? callFunction() : ''}}
<div *ngIf="chat.sender == currentuser || chat.receiver == currentuser">
<p class="chat-date" id="abc" #abc>{{chat.date | amDateFormat:'LL'}}</p>
{{checkdate()}}
</div>
Run Code Online (Sandbox Code Playgroud)
chat.date值是firebase值.我访问这个元素.但我没有得到元素的价值.
这是我的组件
import {Component, ElementRef,ViewChild, OnInit} from '@angular/core';
export class ChatPage {
@ViewChild(Content) content: Content;
@ViewChild('abc')abc: ElementRef;
constructor(){}
ngAfterViewInit(){
console.log("afterinit");
console.log(this.abc.nativeElement.value);
}
}
Run Code Online (Sandbox Code Playgroud)
我引用了这个链接如何在组件模板中选择一个元素?
我试过很多方面.
但是我收到了这个错误
Cannot read property 'nativeElement' of undefined.
Run Code Online (Sandbox Code Playgroud) 我是离子新手,我使用离子cli开始基本的标签项目.一切都工作正常,除非我尝试使用redmi note 4的"ionic cordova run android"命令给出以下错误.
错误:无法在设备上执行shell命令"input,keyevent,82"":错误:adb:命令失败,退出代码为137
它在redmi note 3上工作正常,以下是从终端登录,任何帮助将不胜感激
[INFO] Running app-scripts build: --platform android --target cordova
[23:22:39] build dev started ...
[23:22:39] clean started ...
[23:22:39] clean finished in 6 ms
[23:22:39] copy started ...
[23:22:39] deeplinks started ...
[23:22:39] deeplinks finished in 64 ms
[23:22:39] transpile started ...
[23:22:45] transpile finished in 5.99 s
[23:22:45] preprocess started ...
[23:22:45] copy finished in 6.38 s
[23:22:46] preprocess finished in 229 ms
[23:22:46] webpack started ...
[23:23:08] webpack finished …Run Code Online (Sandbox Code Playgroud) ionic2 ×10
angular ×7
ionic3 ×4
typescript ×3
cordova ×2
adb ×1
font-awesome ×1
icons ×1
ionic4 ×1