Skip to content

Instantly share code, notes, and snippets.

@EddyVerbruggen
Forked from rowdyrabouw/app.component.html
Last active January 26, 2017 13:51
Show Gist options
  • Save EddyVerbruggen/f85cdcf4937270ab0378217ddf397cc1 to your computer and use it in GitHub Desktop.
Save EddyVerbruggen/f85cdcf4937270ab0378217ddf397cc1 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: string) => {
console.log("Your app's version is: " + v);
this.appVersion = v;
});
}
}
JS: Your app's version is: 1.0
JS: EXCEPTION: Uncaught (in promise): TypeError: Cannot set property 'appVersion' of null
JS: ORIGINAL STACKTRACE:
JS: Error: Uncaught (in promise): TypeError: Cannot set property 'appVersion' of null
JS: at resolvePromise (/data/data/org.nativescript.temp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:416:31)
JS: at /data/data/org.nativescript.temp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:452:17
JS: at ZoneDelegate.invokeTask (/data/data/org.nativescript.temp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:223:37)
JS: at Object.onInvokeTask (/data/data/org.nativescript.temp/files/app/tns_modules/@angular/core/bundles/core.umd.js:4396:41)
JS: at ZoneDelegate.invokeTask (/data/data/org.nativescript.temp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:222:42)
JS: at Zone.runTask (/data/data/org.nativescript.temp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:123:47)
JS: at drainMicroTaskQueue (/data/data/org.nativescript.temp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:355:35)
JS: Unhandled Promise rejection: Cannot set property 'appVersion' of null ; Zone: angular ; Task: Promise.then ; Value: TypeError: Cannot set property 'appVersion' of null TypeError: Cannot set property 'appVersion' of null
JS: at /data/data/org.nativescript.temp/files/app/app.component.js:10:29
JS: at ZoneDelegate.invoke (/data/data/org.nativescript.temp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:190:28)
JS: at Object.onInvoke (/data/data/org.nativescript.temp/files/app/tns_modules/@angular/core/bundles/core.umd.js:4405:41)
JS: at ZoneDelegate.invoke (/data/data/org.nativescript.temp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:189:34)
JS: at Zone.run (/data/data/org.nativescript.temp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:83:43)
JS: at /data/data/org.nativescript.temp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:449:57
JS: at ZoneDelegate.invokeTask (/data/data/org.nativescript.temp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:223:37)
JS: at Object.onInvokeTask (/data/data/org.nativescript.temp/files/app/tns_modules/@angular/core/bundles/core.umd.js:4396:41)
JS: at ZoneDelegate.invokeTask (/data/data/org.nativescript.temp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:222:42)
JS: at Zone.runTask (/data/data/org.nativescript.temp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:123:47)
JS: Error: Uncaught (in promise): TypeError: Cannot set property 'appVersion' of null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment