Skip to content

Instantly share code, notes, and snippets.

@rowdyrabouw
Last active January 26, 2017 14:04
Show Gist options
  • Save rowdyrabouw/15ea7b330c4a3608be30bd3fcc333c70 to your computer and use it in GitHub Desktop.
Save rowdyrabouw/15ea7b330c4a3608be30bd3fcc333c70 to your computer and use it in GitHub Desktop.
<StackLayout>
<Label [text]="appVersion"></Label>
</StackLayout>
import {Component, OnInit} from "@angular/core";
let appversion = require("nativescript-appversion");
@Component({
selector: "my-app",
templateUrl: "app.component.html",
})
export class AppComponent implements OnInit {
appVersion: string;
constructor() {
}
public ngOnInit() {
appversion.getVersionName().then((v) => {
console.log("Your app's version is: " + v);
this.appVersion = v;
});
}
}
JS: Your app's version is: 1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment