nativescript

NativeScript + Angular Navigation context

我的未来我决定 提交于 2019-12-10 11:22:25
问题 i'm trying to navigate between a list to a details page. Since i've already fetched everything in my list component i'd like to pass the JSON to the details page so that i've already everything I need to render the component. I tried many things this._router.navigate(['details', JSON.stringify(item)]) // seems to truncate the JSON this._router.navigate(['details', item]) // raises an Cannot match any routes Then i tried to remove the :item url parameter from the route definition and was

Nativescript with Angular error when using HttpClient

妖精的绣舞 提交于 2019-12-10 10:55:39
问题 I am trying to use the Angular's HttpClient in my Nativescript application but when I import it in my component I get Error: Trying to link invalid 'this' to a Java object Update I also tried adding this in the Groceries example without changing anything else and it doesn't work { "description": "ArkCash", "license": "SEE LICENSE IN <your-license-filename>", "readme": "NativeScript Application", "repository": "<fill-your-repository-here>", "nativescript": { "id": "arkcash.chbtechnologies.ch

Hide Tab Buttons in NativeScript TabView

こ雲淡風輕ζ 提交于 2019-12-10 10:45:50
问题 I'm using Nativescript with Typescript/Angular and, for both iOS and Android, I'd like to hide the navigation tab buttons completely without losing the swipe functionality between the tabs. Said another way: I want the tab content, but not the buttons. I'm open to other suggestions to gain the same functionality without the tab navigation menu. The closest answer I could find was this: NativeScript How to hide tab buttons from TabView However, this answer didn't work. It caused the entire

NativeScript Sidekick - UnhandledPromiseRejectionWarning: primordials is not defined

南楼画角 提交于 2019-12-10 10:35:01
问题 When starting up NativeScript Sidekick, I am presented an exception from the Windows stating the following (this error message also shows up in the output Errors in Sidekick): UnhandledPromiseRejectionWarning: ReferenceError: primordials is not defined (for easier reading the full stack trace of the error can be found at the bottom) I have literally not done anything except install NativeScript Sidekick and open the application. How do I resolve this issue? (CLI) (node:6632)

Is there localstorage in nativescript?

不打扰是莪最后的温柔 提交于 2019-12-10 03:54:24
问题 How to share the data across the pages which resides in application.Can anyone tell about localstorage in nativescript? 回答1: You can use either with global.foo, it will available for whole app or you can use application-settings module var applicationSettings = require("application-settings"); //set somewhere like this applicationSettings.set<Number|String|Boolean>("sharedVar",1); //get sharedVar somewhere applicationSettings.get<Number|String|Boolean>("sharedVar");//if empty it will be null

NativeScript - Launch another app from Nativescript app

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-09 20:16:38
问题 In NativeScript, is it possible to launch another app from within a Nativescript app? Let's say I have a button in an app and when pressed it launches the Waze Navigation app with coordinates to a location. Is this possible with NativeScript? Thanks. 回答1: Waze uses the url scheme 'waze://' which you will need to first register in your Info.plist if your app will be running on devices w/ iOS 9 and later. <key>LSApplicationQueriesSchemes</key> <array> <string>waze</string> </array> You can then

Kiosk mode in NativeScript for Android App

那年仲夏 提交于 2019-12-09 20:08:39
问题 From past few days, I am trying to implement kiosk mode (Locked app) in NativeScript with Angular for Android App. I have tried it directly but unable to handle all the buttons in Android like Home and Recent Apps buttons. I am able to handle Back and Volume up and down buttons. The other way, I tried is creating my own Plugin using Android Native but I was unable to do so. There are two options for Kiosk mode in Android Native. One is Screen Pinning (Programmatically) and the other is using

How to listen for volume up/down key in android with nativescript?

核能气质少年 提交于 2019-12-09 14:00:00
问题 I just want to know how to access volume up and down key in native script. 回答1: To do that in NativeScript you can use the code provided by James and extend the main activity for your Android NativeScript application. Below I am going to describe the steps needed to achieve that functionality with TypeScript project. Create new file in your app folder called activity.android.ts in the newly created file extend the Activity and overwrite dispatchKeyEvent as done here in my demonstration

Angular 2 do not refresh view after array push in ngOnInit promise

牧云@^-^@ 提交于 2019-12-09 03:31:03
问题 I created a NativeScript app with angular 2, i have an array of objects that i expect to see in the frontend of the application. the behaviour is that if i push an object into the array directly inside the ngOnInit() it works, but if i create a promise in the ngOnInit() it doesn't work. here is the code: export class DashboardComponent { stories: Story[] = []; pushArray() { let story:Story = new Story(1,1,"ASD", "pushed"); this.stories.push(story); } ngOnInit() { this.pushArray(); //this is

Embedded YouTube videos in Html/WebView in NativeScript iOS

人走茶凉 提交于 2019-12-08 13:32:47
问题 I am trying to implement embedded YouTube videos in Html/WebView in Nativescript iOS. I was able to get it done on android, as I don't have enough native iOS experience I am posting the question here. I found some links but they deal with native iOS in ObjC and Swift. How to embed YouTube video on iOs and play it directly on UIWebview without full screen Can someone guide me to get this done? Update: Here is the screenshot of Android and iOS that I am getting by using in src of WebView