ionic2

How does the app know a component is a page

荒凉一梦 提交于 2020-01-14 12:02:38
问题 Now that the @Page decorator had been deprecated, how does the app differentiate between a component that should be used as part of a page and a component that represents a page you can navigate to? The only difference I see that page components have no selector property defined in the @Component decorator. 回答1: A component is considered to be a page if it's pushed to the navigation controller's stack. A selector property is optional in an Angular2 component. You only need it when you want to

TypeError: Cannot read property 'substr' of undefined - source-node.js

廉价感情. 提交于 2020-01-14 08:48:06
问题 This error comes as a result of resolving this question Here is my ionic info : Cordova CLI: 6.5.0 Ionic Framework Version: 2.0.0 Ionic CLI Version: 2.2.1 Ionic App Lib Version: 2.2.0 Ionic App Scripts Version: 1.0.0 ios-deploy version: Not installed ios-sim version: Not installed OS: Windows 10 Node Version: v7.4.0 Xcode version: Not installed (I am also using npm v4.1.1 ) When attempting to build @ionic/app-scripts , I am getting the following error: E:\Documents\Year_3\Mobile_Application

ionic 2 DatePicker

不想你离开。 提交于 2020-01-14 08:44:06
问题 I'm new to ionic and I'm playing with ionic 2 beta. I'm trying to implement a native datepicker using cordova plugin like in the documentation. I've fully copy/paste the example, and I get "ReferenceError: DatePicker is not defined on Nexus 5 Emulator and Archos android phone. openDatePicker() { var options = { date: new Date(), mode: 'date' }; function onSuccess(date) { alert('Selected date: ' + date); } function onError(error) { // Android only alert('Error: ' + error); } DatePicker.show

TypeError: Argument 3 of SubtleCrypto.wrapKey does not implement interface CryptoKey

╄→гoц情女王★ 提交于 2020-01-14 06:21:11
问题 I am using Ionic 2 and would like to implement js-jose. It has a jose.min.js file. Question Within the Ionic2 structure, how do I import the js-jose library? UPDATE This is what I did. It builds with no errors, however, when I run the encrypt function, it does not enter the Promise . The following is printed: encryptPerson: Object { id=8, joiningDate=1472815177067, lastAccessDate=1475158964295, more...} encrypt: password1 But I would also expect it to print the following, but it does not.

how to upgrade codebase ionic v1 to ionic v3

筅森魡賤 提交于 2020-01-14 04:18:18
问题 I am facing issue in ionic 1 and this framework is deprecated. how to upgrade ionic 1 to ionic 3 without huge modifying in codebase. anyone help in this Note: ionic build ios those command all are not working Advance Thanks 回答1: without huge modifying in codebase This is not going to be possible. Ionic 1 to 2/3 is a large jump from AngularJS to Angular2, which requires a switch to typescript and other fundamental framework alterations. Here is a good post about AngularJS vs Angular2 Here is a

Ionic2, how to import custom plugin (appsee or uxcam) into Ionic App

此生再无相见时 提交于 2020-01-14 02:12:10
问题 I am trying to use Appsee or UXcam I tried import like below, but no luck // import { Appsee } from '@ionic-native/appsee'; Else where i saw that you have to declare the variable in question for typescript to recognize the variable, I did that like below declare var cordova:any; // import { Appsee } from '@ionic-native/appsee'; declare var cordova:any; @Component({ templateUrl: 'app.html' }) export class MyApp { rootPage:any = LoginPage; // FOR TESTING constructor(platform: Platform,

Template parse: The pipe could not be found

余生长醉 提交于 2020-01-13 19:00:27
问题 I am getting the error: Template parse errors: The pipe 'amDateFormat' could not be found Here is my app.module.ts import { NgModule } from '@angular/core'; ... import { MomentModule } from 'angular2-moment'; ... @NgModule({ declarations: [ MyApp ], imports: [ ... MomentModule, ... ], bootstrap: [IonicApp], entryComponents: [ MyApp ], providers: [ ... ] }) export class AppModule { } Then in service-booking-details.ts I am doing the following: import { Component} from '@angular/core'; import {

Angular 2 Ionic 2 - How to set max or min date to today for date input?

99封情书 提交于 2020-01-13 09:25:34
问题 <input class="alert-input date-input" #dob="ngModel" name="dob" max="2018-03-07" [(ngModel)]="leadDetail.dob" type="date"></div> How can I set the max date for today instead of 2018-03-07 dynamically? I tried following methods- <input max="today" type="date"></div> <input max="{{today | date:'yyyy-mm-dd'}}" type="date"></div> Class - public today = new Date(); but no luck. 回答1: Try this: <input class="alert-input date-input" name="dob" [max]="today" type="date"> today = new Date().toJSON()

Ionic2/Angular2 - How to swipe (right and left) between views/pages and tabs?

喜夏-厌秋 提交于 2020-01-13 02:50:09
问题 I am willing to implement a swipe right/left gesture between tabs/pages, like the one here: https://camo.githubusercontent.com/90e2e5abbe8155744d579951b93a1260edef855e/687474703a2f2f692e696d6775722e636f6d2f7a6c66574461312e676966 Also available on GitHub through this link (for iOS) https://github.com/cwRichardKim/RKSwipeBetweenViewControllers Another example, but that one was made based on Ionic1: www.ionic-sarav.rhcloud.com/ionic/tabbedSlideBox/slidingTabsUsingRepeat.html Anyone knows how to

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

时间秒杀一切 提交于 2020-01-13 01:28:26
问题 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"