New! Check out Ionic Native. It's like ngCordova but for ES6 and TypeScript.

$cordovaAppVersion

Reads the version of your app from the target build settings.

cordova plugin add https://github.com/whiteoctober/cordova-plugin-app-version.git

Methods

getVersionNumber()

Get the version number of the current app running.

Returns String, with the version number

getVersionCode()

Get the build identifier of the app

Returns String, with the build identifier

getAppName()

Get the name of the app

Returns String, with the app name

getPackageName()

Get the package name of the app

Returns String, with the package name

Example

module.controller('myCtrl', function($scope, $cordovaAppVersion) {

  document.addEventListener("deviceready", function () {

    $cordovaAppVersion.getVersionNumber().then(function (version) {
      var appVersion = version;
    });
  }, false);

  $cordovaAppVersion.getVersionCode().then(function (build) {
    var appBuild = build;
  });


  $cordovaAppVersion.getAppName().then(function (name) {
    var appName = name;
  });


  $cordovaAppVersion.getPackageName().then(function (package) {
    var appPackage = package;
  });


});