Questions tagged [ionic2]

Ionic 2 is the next generation of Ionic, the open source SDK that enables developers to build performant, high-quality mobile apps using familiar web technologies (HTML, CSS, and JavaScript). Ionic 2 is usually paired with Angular (2). Ionic 2 can also be used as a CSS framework but you'll miss out on the powerful gestures, UI animations and more useful things.

What is Ionic 2?

Ionic 3 was released on 7 April 2017 to overtake Ionic 2.

Ionic 2 was the next generation of Ionic's initial release, the open source SDK that enabled developers to build performant, high-quality mobile apps using familiar web technologies (HTML, CSS, and JavaScript).

Ionic 2 was usually paired with Angular (2). Ionic 2 could also be used as a CSS framework but that would void the powerful gestures and UI animations made to mimic native mobile interaction.


How to install and setup a project

Installing Ionic 2 can be done using npm and the ionic cli.

To install Ionic 2 run $ npm install -g ionic cordova. This will immediately install the ionic cli so all your ionic commands are ready to be used.

To setup a project with different :

  • tabs: $ ionic start myApp tabs
  • sidemenu: $ ionic start myApp sidemenu
  • blank: $ ionic start myApp blank

Where tabs will create an application where 4 tabs (positioned at the bottom of the screen are generated), sidemenu will generate a project with a sidemenu (also showing good use of NavController utilities) and blank will generate a project with just a single page.


Maturity/Version

Ionic 2's current version is 3.12.0. The first release of the final version. (as of 8 March, 2017).

how to install the latest version

If you want to create a new project with 3.12.0: $ npm install -g ionic

If you want to update an existing project to 3.12.0:

Update your package.json to match the following dependencies, remove the existing node_modules directory, and then run npm install:

  "dependencies": {
    "@angular/common": "2.4.8",
    "@angular/compiler": "2.4.8",
    "@angular/compiler-cli": "2.4.8",
    "@angular/core": "2.4.8",
    "@angular/forms": "2.4.8",
    "@angular/http": "2.4.8",
    "@angular/platform-browser": "2.4.8",
    "@angular/platform-browser-dynamic": "2.4.8",
    "@angular/platform-server": "2.4.8",
    "@ionic/storage": "2.0.0",
    "ionic-angular": "2.2.0",
    "ionic-native": "2.4.1",
    "ionicons": "3.0.0",
    "rxjs": "5.0.1",
    "sw-toolbox": "3.4.0",
    "zone.js": "0.7.2"
  },
  "devDependencies": {
    "@ionic/app-scripts": "1.1.4",
    "typescript": "2.0.9"
  }

Read more at 1


Useful Ionic 2 links

And of course the active community of Stack Overflow.

12143 questions
39
votes
8 answers

Remove ion item divider

How I can remove divider? I have the following code to show 4 items in a row:
TheUnreal
  • 23,434
  • 46
  • 157
  • 277
39
votes
1 answer

Property binding ngForIn not used by any directive on an embedded template - Ionic 2

Trying to run a *ngFor within the html like this. But, this error shows up. Property binding ngForIn not used by any directive on an embedded template This is the html code: I've had this happen in my previous…
Nick Snick
  • 911
  • 1
  • 9
  • 16
38
votes
17 answers

Ionic 2 Images not displaying on device

It just seems the simplest of things such as using the correct url path for an image can consume so much time and effort with no success at all. So, in my homepage I tried to use one of the following:
bluewavestudio
  • 551
  • 2
  • 6
  • 13
38
votes
2 answers

Google store says Ready to Publish

I'm trying to publish my ionic2 app on Google play.But still, I cannot do that.It doesn't show any errors.Can you tell me how to do this? When I press the "Ready to Publish" button then it shows below screen.
Sampath
  • 63,341
  • 64
  • 307
  • 441
38
votes
7 answers

How to detect if I am in browser (local development) in Ionic 2

I want to make sure to launch inappbrowser only if I am on devices (iOs, Android...), but if I am in browser (local development mode or just a Web App with gulp build), I want to just link to that page with target="_blank". I am trying to reuse the…
Hugh Hou
  • 2,344
  • 5
  • 31
  • 55
37
votes
4 answers

Ionic 2 : Refresh tabs view after adding a new dynamic tab

I'm using ionic tabs. Some tabs are generated from database (the ones without icons) Now when i add a new tab and refresh the array i should get 3 dynamic tabs. Instead i have 5 (the 2 previous ones and the 2 previous ones with the newest created…
Brieuc
  • 3,994
  • 9
  • 37
  • 70
37
votes
5 answers

Could not find gradle wrapper within Android SDK. Might need to update your Android SDK

I am trying to take build in an ionic2 application. I got this error while running ionic build android. The error log is ANDROID_HOME=/home/varun/Android/Sdk JAVA_HOME=/usr/lib/jvm/java-8-oracle Error: Could not find gradle wrapper within Android…
user3260023
35
votes
7 answers

How to remove the padding around ion-item?

I want to remove padding from my ion-item so that it can occupy the full width of the page. Please look in the dev tools to see the padding around the ion-item.
Aditya
  • 2,358
  • 6
  • 35
  • 61
35
votes
13 answers

Automatic signing is unable to resolve an issue with the "projectName" target's entitlements file

I am new to mac and i am getting this error as below What should i do i have bought the developer licence and i created the provisioning certificate but still i am facing this issue. i am not sure why i am getting this error any help. i have…
Mohan Gopi
  • 7,606
  • 17
  • 66
  • 117
35
votes
6 answers

ionic geolocation plugin error: "No provider for Geolocation"

I'm trying to use geolocation in my ionic2 hello world project, and I add the ionic plugin "Geolocation" following the instruction on the official site. I've run these two commands: $ ionic plugin add cordova-plugin-geolocation $ npm install --save…
awmleer
  • 1,658
  • 3
  • 13
  • 28
35
votes
9 answers

Xcode has conflicting provisioning settings

I have an Ionic 2 app, which builds and is testable in Xcode 8.2.1 Simulator environment, e.g. iPhone7 (Build Successful). When I try Archive the app to create an ipa file to set on a device, I follow these instructions. But Product -> Archive is…
Richard
  • 8,193
  • 28
  • 107
  • 228
35
votes
6 answers

Ionic 2 + Angular 2: Images prepended with 'unsafe:' therefore not displaying even though they're fine

For some reason, some of my images are being prepended with 'unsafe:', which is causing them not to be rendered. Q) Why is this happening and how can I fix it - Is this Angular 2 being odd with whitelisting or Ionic 2? e.g.

Dave
  • 5,283
  • 7
  • 44
  • 66
35
votes
4 answers

Ionic 2, Using Angular 2 Pipe breaks on iOS—"Can't find variable: Intl"

Experiencing the same problem with the date, percent, and currency pipes when using them in a template— For example, I'm using a simple percent pipe: {{ .0237| percent:'1.2-2' }} It works when running on Chrome, but when I deploy to an iOS device,…
Hunter
  • 405
  • 2
  • 5
  • 10
34
votes
3 answers

How can I easily concatenate typescript variable with string in html tag?

This is my html code with ionic 2

...

Emeka Obianom
  • 1,736
  • 3
  • 17
  • 36
34
votes
6 answers

No provider for AngularFireDatabase, AngularFireAuth

Apologies as I can't think of a better way of including all the information... When I run this, I get an error saying the following. I've followed the Ionic Docs to the T, I can't figure out what could possibly be wrong. Error: No provider for…
Slabach
  • 391
  • 1
  • 4
  • 9