我正在尝试执行GET请求并从响应中检索数据。
this.http.get('http://localhost:8888/maneappback/more-items.php').subscribe(res => {
console.log(res.json());
}, (err) => {
console.log(err);
});
Run Code Online (Sandbox Code Playgroud)
我得到了错误SyntaxError: Unexpected token C in JSON at position 0。我还假设该错误与请求有关。
在服务器端,我像这样(PHP)发送数据:
echo json_encode($array);
运行$ ionic generate page pageName导致错误:
Generators are only available for Ionic 2 projects (CLI v2.2.2) Your system information: Cordova CLI: 7.0.1 Ionic Framework Version: 2.3.0 Ionic CLI Version: 2.2.2 Ionic App Lib Version: 2.2.1 Ionic App Scripts Version: 1.1.4 ios-deploy version: 1.9.1 ios-sim version: 5.0.13 OS: macOS Sierra Node Version: v8.0.0 Xcode version: Xcode 8.3.3 Build version 8E3004b
这是从一个离子v2项目开始,但我认为我已更新为离子3. 按照说明更新到CLI v3后,我仍然得到同样的错误.
是否可以在TypeScript中为"hold click"事件分配按钮?
喜欢:
<button ion-button icon-only color="royal" (click)="addNote()" (holdclick)="removeNote()">
Run Code Online (Sandbox Code Playgroud) 我正在Windows 10上使用git bash,最近将其更新为创建者更新。
每当我尝试在分支之间切换时,我都会得到以下提示
$ git fetch && git checkout master
warning: unable to rmdir Ionic_Developemnt: Directory not empty
Checking out files: 100% (6312/6312), done.
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
Run Code Online (Sandbox Code Playgroud)
我不知道为什么会这样,在Ionic_Development文件夹中还有一个.git隐藏文件夹
任何人都可以提供帮助,为什么会出现错误_ / _
我正在尝试ion-select使用json对象动态填充下拉列表.
我的html组件如下所示:
<ion-item [hidden]="editOptions.isEditing">
<ion-note stacked color="primary">{{label}}</ion-note>
<ion-note class="inline-edit"> {{value}} </ion-note>
</ion-item>
<ion-item [hidden]="!editOptions.isEditing">
<ion-label stacked color="primary">{{label}}</ion-label>
<ion-select [(ngModel)]="value" [selectOptions]="additionalData" [required]="required" [name]="value">
<!--<ion-option>None</ion-option>-->
</ion-select>
</ion-item>
Run Code Online (Sandbox Code Playgroud)
在我的调用代码中,我尝试填充选择选项,但他们在文档中没有示例
additionalData = {
title: 'Pizza Toppings',
subTitle: 'Select your toppings',
mode: 'md'
};
Run Code Online (Sandbox Code Playgroud)
如何在不使用html中的*ngFor的情况下将我的选项添加到此选择中?我宁愿像这样传递它们:
additionalData = {
title: 'Pizza Toppings',
subTitle: 'Select your toppings',
mode: 'md'
options: [{id:1, description:'Pepperoni'}]
};
Run Code Online (Sandbox Code Playgroud) 我正在尝试在一个简单的Google地图上获得几个标记。我正在使用使用Angular 4的Ionic 3。
我正在这样加载地图:
import { Component, ViewChild, ElementRef } from '@angular/core';
import { GoogleMaps } from '@ionic-native/google-maps';
declare var google;
export class SearchResultsPage extends BasePage {
@ViewChild('map') mapElement: ElementRef;
private map: any;
constructor(public navCtrl: NavController,
public navParams: NavParams,
private translateService: TranslateService,
private googleMaps: GoogleMaps) {}
ionViewDidLoad() {
setTimeout(()=>{
this.loadMap();
}, 1000)
}
loadMap() {
let latLng = new google.maps.LatLng(48.8509695, 2.3861870000000636);
let latLng2 = new google.maps.LatLng(48.8504541, 2.3865487000000485);
let mapOptions = {
center: latLng,
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
this.map = …Run Code Online (Sandbox Code Playgroud) 我已经创建了一个自定义插件,我正在尝试通过cmd添加它以获得以下错误
> cordova plugin add C:\r\work\custom_plugins\cordova-plugin-webrtc-video-call -
-save
x Running command - failed!
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova plugin add
C:\r\work\custom_plugins\cordova-plugin-webrtc-video-call --s... (exit
code 1):
Error: Failed to get absolute path to installed module
C:\r\work>
Run Code Online (Sandbox Code Playgroud)
config.xml中
<?xml version='1.0' encoding='utf-8'?>
<plugin id="cordova-plugin-webrtc-video-call" version="1.0.1" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<name>WebrtcVideoCall</name>
<js-module name="WebrtcVideoCall" src="www/WebrtcVideoCall.js">
<clobbers target="cordova.plugins.WebrtcVideoCall" />
</js-module>
<platform name="android">
<config-file parent="/*" target="res/xml/config.xml">
<feature name="WebrtcVideoCall">
<param name="android-package" …Run Code Online (Sandbox Code Playgroud) 你好我正在用Ionic构建一个应用程序,我想在应用程序启动时删除启动画面上的加载微调器,任何解决方案吗?
目前正试图签署我的apk已经使用离子v2构建,遵循他们的文档中离子建议的确切程序:http://ionicframework.com/docs/v1/guide/publishing.html
但由于某些原因,我在上传到播放控制台时收到此错误:您上传了一个带有无效签名的APK(了解有关签名的详情).来自apksigner的错误:错误:JAR_SIG_NO_SIGNATURES:没有JAR签名
很遗憾在谷歌上很少提到这个错误(并且没有关于离子).最奇怪的是,我几个月前签署的应用程序没问题,但最近才遇到这个问题.有人可以帮忙吗?
ionic-framework ×10
angular ×4
ionic2 ×4
ionic3 ×4
android ×2
javascript ×2
typescript ×2
bash ×1
cordova ×1
git ×1
google-maps ×1
jarsigner ×1
json ×1
keytool ×1
php ×1
windows ×1
zipalign ×1