Most voted "ionic2" questions
Ionic 2 is the second version of the Ionic framework that aims to create hybrid applications for mobile devices. Use this tag for questions about features specific to version 2, for general questions use the tag [Ionic].
Learn more…217 questions
Sort by count of
-
7
votes1
answer6590
viewsFunction "change" with <ion-select><ion-option>
all right? I’m struggling, I hope you can help me... I’m studying Ionic 2 a little while and thought I’d make a simple application. In Javascript I managed to do it quietly, but with Ionic does not…
-
6
votes2
answers1862
viewsGroupby in Javascript
I’m getting the following result from a query: [ { "disciplina":"Portugues", "periodo":"1º Bimestre", "tipo":"1ª avaliacao", "valor":9.5 }, { "disciplina":"Matematica", "periodo":"1º Bimestre",…
-
5
votes2
answers1846
viewsHow to create a static method in a public class?
I would like to create a static method in a public class with a ToastController so that I can access this method in several classes. I tried to do this way below but it didn’t work: export class…
-
4
votes2
answers4622
viewsWhat command using *ngIf to do a larger and smaller check
I’m using ngIF only to change the color of the object, but I’m needing to create one that the result.Mediatotal is less than 70 and greater than 50. What is the correct syntax to do this:…
-
4
votes1
answer198
viewsHow to perform a type of href with parameters on an image using Ionic / Angularjs
I have this snippet of code, which shows an image with a CSS on top: <img class="imagemCapa" image-lazy-loader="lines" ng-src="{{item.cadastra_oferta_foto}}" /> <div…
-
4
votes1
answer770
viewsHow to remove a page from Ionic 2 / 3 navigation
In a hybrid application with Ionic 3 I have 3 pages that are part of the process of buying a product. The process is as follows: The user is in the cart and click on "Choose payment method" In case…
-
4
votes1
answer221
viewsIonic with admob-free advertising displays only "Nice Job"
I created an application with Ionic version: 3.20.1 and set up with admobfree: cordova plugin add cordova-plugin-admob-free --save --variable ADMOB_APP_ID="ca-app-pub-XXXXXXXXXXXXXXXX/XXXXXXXXXX"…
-
3
votes2
answers139
viewsTypescript Error Ionic 2
Following Error: Type 'typeof Loginpage' is not Assignable to type 'typeof Homepage'. Code: import { LoginPage } from '../pages/login/login'; if(user) { this.rootPage = HomePage; } else {…
-
3
votes1
answer1135
viewsIonic2 add element in view
I need to create a click event that when pressed creates an input in the view. How can I do that? Thank you Ps: ionic2 typescript use HTML <ion-navbar *navbar> <ion-title> POSimplex…
-
3
votes1
answer1025
viewsHow to change the color of Ion-item Input and Android Bar?
How do I change from "blue" when I click the input to the color I want in the ion-input? I just managed to change the placeholder color with: *::-webkit-input-placeholder { color: rgb(255,255,255)…
-
3
votes2
answers981
viewsAngular2 ngFor help with loop
I have a file nvi.json that is this way: [ { "abbrev": "gn", "book": "Gênesis", "chapters": [ { "1": { "1": "...", "2": "..." } }, { "2": { "1": "...", "2": "..." } }, { "3": { "1": "...", "2":…
-
3
votes1
answer609
viewsError while trying to run Ionic serves windows
When I try to start my Ionic project this giving the following error: 0 info it worked if it ends with ok 1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe', 1 verbose cli 'C:\\Program…
-
3
votes1
answer708
viewsMy device does not update when making a modification to Ionic code
I have a problem, when making a change in the code of the application like put a color or a title of something, on my device does not update, but in the browser yes, put a hello on the home page and…
-
3
votes1
answer216
viewsIonic 2 - Onesignal - Get player_id
I use Onesignal for push notifications in an Ionic 2 application. To send notifications targeted to specific users I need to recover player_id from Onesignal. Does anyone have any idea how to…
-
3
votes1
answer419
views -
3
votes1
answer183
viewsNavigation by Id Ionic 2
hello. I am developing an application with Ionic 2 and I am with the following situation. I have 2 tables, 'stores' and 'publications'. My question is, how to do from the 'store' listing to open…
-
2
votes0
answers99
viewsSet the ion-radio as required
I am mounting a dynamic form using ionic2, but multiple choice components do not accept the property required how would I do that on Ionic? The component I’m trying to put property required is the…
-
2
votes5
answers1534
viewsIonic 2 - Status Bar
I am unable to change the color of my Status Bar with Ionic 2. I have checked the documentation and am doing the following. app js. import {StatusBar} from 'ionic-native'; app.js (constructor())…
-
2
votes2
answers844
viewsHow can I filter, both by Category and by Price?
I have 2 filter buttons: Sort by Price - That Works. Sort by Category - Doesn’t Work. I would like to operate the filter both by price and by category. Both are modal and I’m doing it this way: O…
-
2
votes1
answer973
viewsGenerators are only available for Ionic 2 Projects
I cannot solve following error: Generators are only available for Ionic 2 projects (CLI v2.1.8) Your system information: Cordova CLI: 6.4.0 Ionic CLI Version: 2.1.8 Ionic App Lib Version: 2.1.4…
-
2
votes1
answer197
viewsError in uploading Ionic app
when I pass the command on my Ionic upload terminal shows the error below and does not move up the file in Ionic view ionic upload Uploading app... An error occurred uploading the build: An error…
-
2
votes2
answers2070
viewsHow do I emulate an Ionic 2 application on the tablet, and also as Gero a . ipa and . apk?
I want to emulate my Ionic 2 application on the tablet but I can’t, I’ve already uploaded an Ionic cloud but only works in the Ionic view app, I’ve also used Ionic emulete and Ionic run, but when I…
-
2
votes1
answer673
viewsDelete item from an Inioc 2 array
I’m having a hard time understanding how splice() works. I need to delete items from an array when I click on (x), e.g.: <ion-item *ngFor="let item of data"> <ion-grid> <ion-row>…
javascript html5 angular ionic2 arraylistasked 7 years, 8 months ago Henrique Mendes Silveira Rodri 367 -
2
votes0
answers316
viewsAngular 2 - Switch the comma value separator to a point
I want the value of my Form to return 2 decimal numbers with a comma separating instead of a dot. Ex: 20 -> 20,00 And if the value is greater than a thousand he has point separating. Ex: 1000…
-
2
votes1
answer119
viewsRedeem user phone number
On Android, using Java, it is possible to redeem the device user’s phone number with the following code: TelephonyManager tMgr = (TelephonyManager)mAppContext.…
-
2
votes0
answers58
viewsIncompatibility android 4.4.2 with Ionic 2
I made an application in Ionic 2 and everything works perfectly, however, a user when using on mobile with android 4.4.2, some features, as for example, file upload, It does not work. Does not…
-
2
votes1
answer121
viewsIonic 2 Onesignal IOS
I have a project developed in IONIC 2 and managed the version for IOS but I have a problem with Onesignal. I tried to reinstall the plugin by Ionic but problem still continues.…
-
2
votes3
answers434
viewsSynchronous query in Sqlite using Ionic
I have the following function below: public requisicaoXPTA() { this.database.executeSql("SELECT * FROM tbl_xpta", []).then((data) => { // o resultado retorna aqu na variável data }, (error) =>…
-
2
votes1
answer1332
viewsDecimal mask on an ion-input type "number"
I need to make a value mask (9 digits with 3 decimals), and when the user starts to enter the value, the field place the commas and point automatically, similar to what happens today in the bank…
-
2
votes1
answer639
viewsIonic 2 how to add Authorization in header
I’ve been trying for days and I can’t with the following method on Ionic 2. getMy() { return this.http.get("users/my", this.setAuthorization(this.headers)) .toPromise() .then(res => res.json())…
-
2
votes1
answer876
viewsDelay on application startup
I created a cross-platform application using Ionic 2 + Angular 2 according to the Get Started of ionic documentation. The basic command to create a project with side menu is this way below: $ionic…
-
2
votes1
answer561
viewsTansformate a JSON response in a list and display the data on the screen with IONIC
Good afternoon guys, whenever I have any doubts I run here hoping you will help me and always get positive answers, from now on my many thanks. Well, I have a little problem here (I don’t have much…
-
1
votes0
answers103
viewsFailed to receive native Ionic 2 Push notifications
I’m developing an application using Ionic 2/Angular 2/Typescript. This application uses Ionic 2’s native push notifications plugin and Google Cloud Message (GCM) in conjunction with Amazon SNS. The…
angular push-notification ionic2 google-cloud-messaging snsasked 8 years, 5 months ago Natanael 131 -
1
votes1
answer1674
viewsRequest header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight
How can I eliminate this mistake? XMLHttpRequest cannot load http://www.ramosdainformatica.com.br/food/apinhac.php. Request header field Content-Type is not allowed by Access-Control-Allow-Headers…
-
1
votes1
answer182
viewsDetecting ion-textarea change with ionic2
I’m developing an app and I needed to detect the ionChange or keyUp of an ion-textarea in Ionic 2. Below are examples that work. my file.ts atualizar() { console.log('Atualizou :)'); } my . html…
-
1
votes2
answers2784
viewsHow to get the return (value) of a Promise in Javascript / Typescript?
I’m starting with Ionic 2, which uses Angular 2, and I’m trying to understand how Promises work, because some libs I’m using work have functions that return Promises and would like to get the value…
-
1
votes1
answer738
viewsInject token into the header of all http requests
I am trying to create a general method to insert a token in all my http requests. I don’t know much about angular 2 but I did it the way below: Filing cabinet generic-service.ts import {Http,…
-
1
votes2
answers308
viewsShow Map with point Ionic 2
Personal use Ionic 2 beta in a project with ts, has the coordinates of a point, I wonder how I can put the map with the current position of the user and a marker in the saved coordinates. How can I…
-
1
votes1
answer85
viewshttp post error
Friends, I would like to have the save method in the class itself, and I’m not getting it, I’m beginner in typescript. import { Injectable } from '@angular/core'; import { Http } from…
-
1
votes1
answer126
viewsProblem with typescript + ionic2
good evening, I have the following problem. I have my project in Ionic and in it I created a folder only for models. app>model (o objetos do meu sistema) > minha-model-a.ts >…
-
1
votes1
answer183
viewsIonic 2 - Any type variables
I’m having trouble migrating from Ionic beta.11 to RC0. Every time I put a constructor waiting for type "any" I get the following error. Ngc error: Error: Error at /Projeto/.…
-
1
votes1
answer1147
viewsInstall IOS app without having to go up in the store
Is it possible to install an IOS app without having to go up in the store? Just like I can just download the . apk and install on android? An example of what I’m talking about:…
-
1
votes2
answers8830
viewsError: Failed to find 'ANDROID_HOME' Environment variable
I am beginner in mobile development and was studying IONIC, when I went to try to generate the test project apk gave the following error: WARN: Ionic.project has been renamed to Ionic.config.json,…
-
1
votes1
answer76
viewsError: Uncaught Ionic 2
I have this: let loader = this.loadingCtrl.create({ dismissOnPageChange: true, }); loader.present().then(authData => { let alert = this.alertCtrl.create({ title: '', message: 'Cadastrado com…
-
1
votes1
answer822
viewsPass html page id inside ngFor to ts page
I have a *ngFor of an array object, I want to pass the id inside the button to typescript to configure it as links in a modal. Follow the syntax I’m trying with no success: <ion-item *ngFor="let…
-
1
votes1
answer258
viewsPage does not load elements when updating to Ionic 2
Well I have an app with side menu where the first page is the home, and it loads elements as soon as the user enters the app. I’m using Ionic 2 and communication is being done via socket. One detail…
-
1
votes1
answer304
viewsion-toggle how to fire event when scoring
I have following code: <ion-item *ngFor="let dispositivo of dispositivos"> <ion-label>{{dispositivo.Nome}}</ion-label> <ion-toggle toggle-class="toggle-positive"…
-
1
votes0
answers158
viewsHow to generate multiple modals in Angular 2 for the same view in Ionic?
sorry ignorance may not have formulated the question correctly, a week ago I started to see a little about Ionic and Angular 2, I came doing some tests and came across the following problem.…
-
1
votes1
answer156
viewsModule Ionic error 2
When I create a page the module is not being recognized, for example user page and signup in my case are not being recognized, how to solve? follows the attached image…
-
1
votes1
answer573
viewsModule.ts Ionic 2
I updated Ionic 2 and angular, but now when I run a page it automatically creates a module.ts file inside the page folder along with html, scss and ts file, does anyone know how to make the…