当用户滚动一个collection-repeat长列表时,我在我的离子应用程序中收到此错误.
ignored attempt to cancel a touchstart event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.
Run Code Online (Sandbox Code Playgroud)
知道这是什么吗?
模板:
<div class="scrollContainer">
<ion-scroll zooming="false" direction="y" overflow-scroll="false">
<div class="loadingboards" ng-if="!transitionFinished">
<ion-spinner class="spinner spinner-ios">
</ion-spinner>
<br/>
Loading boards list...
</div>
<div id="boardselection" ng-if="transitionFinished">
<ion-item collection-repeat="item in prodataSelect | orderBy:data.sort | filter: data.selectBrand.brand:true | filter: data.selectName.name | unique:'modelStrict'" item-width="96%" item-height="'18%'">
<a class="optionfuninit item-content" data-proid="{{item.id}}" ng-click="whatToDo(item.id,$event);" ng-class="item.fun == '0' ? 'aNormal' :( item.fun == '1' ? 'aSmallWave' : (item.fun …Run Code Online (Sandbox Code Playgroud) 如何创建一个带+和 - 按钮的输入框.点击哪个用户可以更改所选产品的数量,例如此屏幕:

我正在使用Ionic 2 Beta 11.我正在尝试向外部API发送请求,该API将返回JSON响应.我已经克服了CORS问题,我正在与API通信但是我无法发送所需的正文信息.我尝试用以下方式格式化body变量,每个都没有成功:
作为对象: {email: this.email, password: this.password}
作为字符串化对象: JSON.stringify({email: this.email, password: this.password})
作为一个字符串: 'email=' + this.email + '&password=' + this.password
这是我的代码:
import {Component} from '@angular/core';
import {NavController, MenuController} from 'ionic-angular';
import {Http, Headers, RequestOptions} from '@angular/http';
import 'rxjs/Rx';
@Component({
templateUrl: 'build/pages/login/login.html'
})
export class LoginPage {
nav: NavController;
username: string;
password: string;
constructor(nav: NavController, private http: Http) {
this.nav = nav;
}
doLogin() {
let body = JSON.stringify({
email: this.username,
password: this.password });
let headers = …Run Code Online (Sandbox Code Playgroud) 我根据这个答案构建了我的应用程序的结构:
结合侧边菜单和标签:
我的app.js文件看起来像这样:
$stateProvider
.state('app', {
url: '/app',
abstract: true,
templateUrl: 'templates/menu.html',
controller: 'AppCtrl'
})
.state('app.tabs', {
url: '/tabs',
views: {
'menuContent': {
templateUrl: 'templates/tabs.html'
}
}
})
.state('app.tabs1.general', {
url: '/tabs1-general',
views: {
'general-tab': {
templateUrl: 'templates/general1.html',
controller: 'General1Ctrl'
}
}
})
.state('app.tabs2', {
url: '/tabs2',
views: {
'menuContent': {
templateUrl: 'templates/tabs2.html'
}
}
})
.state('app.tabs2.general', {
url: '/tabs2-general',
views: {
'general2-tab': {
templateUrl: 'templates/general2.html',
controller: 'General1Ctrl'
}
}
})
$urlRouterProvider.otherwise('/app/ofertas/ofertas-reporte');
Run Code Online (Sandbox Code Playgroud)
当我在otherwiseurlRouterProvider 的方法中测试设置路由的所有路由时,一切正常,但是当我在侧栏设置路由时,URL不匹配:
我的菜单在这里:
<ion-content>
<ion-list …Run Code Online (Sandbox Code Playgroud) 情况:
我想在我的Ionic 2应用程序中创建一个非常简单的登录表单.
无论我尝试什么,我都会收到这个错误:
formGroup expects a FormGroup instance. Please pass one in.
Run Code Online (Sandbox Code Playgroud)
代码:
页面组件:
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { FormGroup, Validators, FormBuilder } from '@angular/forms';
@Component({
selector: 'login-page',
templateUrl: 'login-page.html'
})
export class LoginPage {
loginForm: FormGroup;
constructor(public navCtrl: NavController, private formBuilder: FormBuilder) {}
ionViewDidLoad()
{
console.log('Login page loaded');
this.loginForm = this.formBuilder.group({
email: ['', Validators.required],
password: ['', Validators.required],
});
}
submitLogin()
{
console.log('Doing login..');
}
}
Run Code Online (Sandbox Code Playgroud)
风景:
<ion-header>
<ion-navbar>
<ion-title>LoginPage</ion-title> …Run Code Online (Sandbox Code Playgroud) 突然之间,我试图运行离子时得到这个.怎么了?
C:\Users>ionic
Unable to parse Ionic Config file. Please make sure it is valid JSON (.ionic/ionic.config)
Caught exception:
SyntaxError: Unexpected token
at Object.parse (native)
at Object.module.exports.load (C:\Users\BBytes\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\lib\config.js:14:26)
at Object.<anonymous> (C:\Users\BBytes\AppData\Roaming\npm\node_modules\ionic\lib\utils\stats.js:31:31)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (C:\Users\BBytes\AppData\Roaming\npm\node_modules\ionic\lib\cli.js:3:18)
Mind letting us know? https://github.com/driftyco/ionic-cli/issues
Run Code Online (Sandbox Code Playgroud) 我现在能够在视图中获取对象但是我无法运行if语句.根据之前的回答,这就是我引入对象的方式.
public getPosts$(category, limit) {
return this.cartService.getPosts(category, limit).map(response => {
return response && response.data && response.data.children;
};
}
ngOnInit() {
this.getPosts$(this.category, this.limit).subscribe(cart => {
this.cart = cart;
}
}
Run Code Online (Sandbox Code Playgroud)
我想跑,但得不到财产蔬菜.
<h2 *ngIf="cart">{{cart.vegetable}}</h2>
<h2 *ngIf="cart.vegetable == 'carrot' ">{{cart.vegetable}}</h2>
Run Code Online (Sandbox Code Playgroud)
错误是
无法读取未定义的属性'vegtable'
它运行在小米Mix 2手机(Android版本8.0.0)和浏览器上没有任何问题.但是当我部署到三星note 2(android版本4.4.2)时,它给出了一条应用程序错误: net :: ERR_CONNECTION_REFUSED(http:// localhost:8080)
为什么我收到此错误?
任何建议和意见将不胜感激.
凯末尔.
无法解析配置“ classpath”的所有文件。
找不到com.google.android.gms:strict-version-matcher-plugin:1.1.0。
Searched in the following locations: https://jcenter.bintray.com/com/google/android/gms/strict-version-matcher-plugin/1.1.0/strict-version-matcher-plugin-1.1.0.pom https://jcenter.bintray.com/com/google/android/gms/strict-version-matcher-plugin/1.1.0/strict-version-matcher-plugin-1.1.0.jar file:/C:/Users/e1706396/.m2/repository/com/google/android/gms/strict-version-matcher-plugin/1.1.0/strict-version-matcher-plugin-1.1.0.pom file:/C:/Users/e1706396/.m2/repository/com/google/android/gms/strict-version-matcher-plugin/1.1.0/strict-version-matcher-plugin-1.1.0.jar Required by: unspecified:unspecified:unspecified > com.google.gms:google-services:4.2.0
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
在https://help.gradle.org上获得更多帮助
7s cmd中的BUILD FAILED:命令失败,退出代码为1
我正在使用插件
<plugin name="cordova-plugin-appavailability" spec="^0.4.2" />
<plugin name="cordova-plugin-camera" spec="^4.0.3" />
<plugin name="cordova-plugin-compat" spec="^1.2.0" />
<plugin name="cordova-plugin-device" spec="^2.0.2" />
<plugin name="cordova-plugin-googleplus" spec="^5.2.1">
<variable name="REVERSED_CLIENT_ID" value="xxx" />
</plugin>
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
<plugin name="cordova-plugin-ionic-webview" spec="^1.1.19" />
<plugin name="cordova-plugin-mfp" spec="^8.0.2018070216" …Run Code Online (Sandbox Code Playgroud)ionic-framework ×10
angular ×3
angularjs ×3
ionic2 ×3
android ×2
ionic3 ×2
javascript ×2
http ×1
ionic-native ×1
ionic-popup ×1
ionic-view ×1