ionic2

How i can get input value within ionic 2 in my Component?

南楼画角 提交于 2020-01-13 01:26:09
问题 i will create a shopping app using ionic 2 , in products details i've created a stepper for increment and decrement value of quantity. My question : how i can get the input value within ionic 2 in my Component ? 回答1: Solution: 1- app/pages/index.html In Angular 2, you should use ngModel in the template. <ion-header> <ion-navbar primary> </ion-navbar> </ion-header> <ion-content> <ion-item> <button lightgray full (click)="incrementQty()">+</button> <ion-item> <ion-input type="number" min="1"

Error Implementing Google Analytics into Ionic 2

≡放荡痞女 提交于 2020-01-12 10:12:52
问题 Trying to integrate Google Analytics ( http://ionicframework.com/docs/v2/native/google-analytics/ ) into my app, followed this tutorial as the docs didn't really have any sort of implementation instructions: https://www.thepolyglotdeveloper.com/2016/03/use-google-analytics-in-an-ionic-2-android-and-ios-app/ However, when I run my app in Simulator I get the following error while compiling: TypeScript error: app/app.ts(21,14): Error TS2339: Property 'analytics' does not exist on type 'Window'.

IONIC 2 Google Maps Marker Click Event

左心房为你撑大大i 提交于 2020-01-12 09:57:21
问题 I'm trying to get all the markers from the database with this code. But the problem is when I click the marker I always get the last item from the database. When the "alert(record.id);" pops up it always show the last item for every marker. I want to show the id of each marker when I click them. loadMarker(){ this.service.getMaps() .subscribe( data1 => { let loc = data1; for (var i = 0; i < data1.length; i++) { var record = data1[i]; let latlng = new GoogleMapsLatLng(record.lat, record.lng);

IONIC 2 Google Maps Marker Click Event

橙三吉。 提交于 2020-01-12 09:57:20
问题 I'm trying to get all the markers from the database with this code. But the problem is when I click the marker I always get the last item from the database. When the "alert(record.id);" pops up it always show the last item for every marker. I want to show the id of each marker when I click them. loadMarker(){ this.service.getMaps() .subscribe( data1 => { let loc = data1; for (var i = 0; i < data1.length; i++) { var record = data1[i]; let latlng = new GoogleMapsLatLng(record.lat, record.lng);

IONIC 2 Google Maps Marker Click Event

萝らか妹 提交于 2020-01-12 09:56:26
问题 I'm trying to get all the markers from the database with this code. But the problem is when I click the marker I always get the last item from the database. When the "alert(record.id);" pops up it always show the last item for every marker. I want to show the id of each marker when I click them. loadMarker(){ this.service.getMaps() .subscribe( data1 => { let loc = data1; for (var i = 0; i < data1.length; i++) { var record = data1[i]; let latlng = new GoogleMapsLatLng(record.lat, record.lng);

WebpackJsonp missing after Ionic 3 update

試著忘記壹切 提交于 2020-01-11 13:49:09
问题 I recently bumped up to ionic 3 from 2. I can build my app for iOS, but ionic serve fails now with the error below. Before I could build for iOS, I had to manually replace main.prod.ts and main.dev.ts with main.ts Would you need any more info to be able to help? Close Runtime Error webpackJsonp is not defined Stack ReferenceError: webpackJsonp is not defined at http://localhost:8100/build/main.js:1:1 Ionic Framework: 2.0.0-rc.3 Ionic Native: 2.2.3 Ionic App Scripts: 2.0.2 Angular Core: 2.1.1

How to handle login errors with Ionic custom auth?

我是研究僧i 提交于 2020-01-11 13:15:06
问题 I'm trying to implement a user login with Ionic Cloud's Auth Service, and would prefer to no show the Cordova inAppBrowser. In case of an authentication error (e.g. wrong password), I would expect the error handler to fire, but for some reason this never seems to be the case. The method in my login component contains this: let loginData = { email: this.email, password: this.password }; let loginOptions: AuthLoginOptions = { inAppBrowserOptions: { hidden: true } }; this.auth.login('custom',

ionic 2 how to load dynamically with index

自闭症网瘾萝莉.ら 提交于 2020-01-11 13:14:13
问题 For ionic 1 i have done like ng-if="$index % 3 === 0" But i need to load the data dynamically in grid view with two col in one row. How can i do that. i tried below code : in my schudle.ts : ResourceData = [{ name: "ksjs" },{ name: "daa" },{ name: "das" }, {name: "das" }, {name: "Computer Science" }, { name: "Moc" }] My html : <div class="item item-body no-padding" style="border-width: 0px !important; overflow-y:hidden;height: 65%;"> <div class="row no-padding" style="height: 65%;" *ngFor=

Ionic 3 redirect from app.component class to another page

青春壹個敷衍的年華 提交于 2020-01-11 11:17:31
问题 I’m getting push notification messages and once I receive the message, I want to redirect to another page or show another page instead of home page. NavController doesn’t work here, so I was wondering what will? export class MyApp{ rootPage:any = HomePage; constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen, public push: Push) { platform.ready().then(() => { // Okay, so the platform is ready and our plugins are available. // Here you can do any higher level native

Ionic 3 redirect from app.component class to another page

自作多情 提交于 2020-01-11 11:16:41
问题 I’m getting push notification messages and once I receive the message, I want to redirect to another page or show another page instead of home page. NavController doesn’t work here, so I was wondering what will? export class MyApp{ rootPage:any = HomePage; constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen, public push: Push) { platform.ready().then(() => { // Okay, so the platform is ready and our plugins are available. // Here you can do any higher level native