angular2-nativescript

Nativescript: Navigate between router-outlets

时光总嘲笑我的痴心妄想 提交于 2020-06-27 07:37:35
问题 For better introduction see the blog post about outlets. I use a TabView to navigate through my mobile app written with nativescript (ProtectedComponent). <TabView #tabView tabsBackgroundColor="#f57c00" selectedTabTextColor="#B23010" [(ngModel)]="selectedIndex" (selectedIndexChanged)="tabViewIndexChange(tabView.selectedIndex)"> <StackLayout *tabItem="{iconSource: 'res://tab-icons/cats'}"> <cats-tab></cats-tab> </StackLayout> <StackLayout *tabItem="{iconSource: 'res://tab-icons/dogs'}"> <dogs

NativeScript Fail to connect to camera service

牧云@^-^@ 提交于 2020-01-25 08:27:09
问题 I'am trying to get access native Api to hardware on NativeScript " i don't use no plugins on my code " . when i fire the function startup(0) or startup(1) up to the camera facing chosed i have this errors . Fail to connect to camera service import { Injectable} from '@angular/core'; import * as SocketIO from "nativescript-socket.io"; import * as permissions from 'nativescript-permissions'; let CAMERA = () => (android as any).Manifest.permission.CAMERA; @Injectable() export class CameraService

How should I keep the status bar and actionbar hidden through navigation in Nativescript?

感情迁移 提交于 2020-01-07 04:42:05
问题 so currently I make an initial call to hide the status bar at the beginning of the app and also set the actionbar to hidden in the constructor of all my components, yet when I open the keyboard in android the status bar shows back up and doens't hide when the keyboard hides. How should I deal with this, especially given the fact that nativescript has no events for on keyboard open and close? I just need to maintain the status bar hidden after the keyboard closes (preferable always). To be

nativescript, angular2 and heaththkit - HKHealthStore not found;

允我心安 提交于 2020-01-07 04:36:11
问题 I am trying to follow the docs at https://github.com/NativeScript/sample-iOS-HealthKit which lets face it is poorly documented... tsk tsk tsk I have healthkit enabled in my xcode project. Per this sample https://github.com/NativeScript/sample-iOS-HealthKit/blob/master/app/components/main/main.ts file I am trying to import: var healthStore: HKHealthStore; cant find name HKHealthStore How to I import properly? Thanks 回答1: That sample 2 years old, from the very early days of NativeScript. Looks

Http request fail on NativeScript Angular

泪湿孤枕 提交于 2020-01-06 08:49:08
问题 I have the Groceries tutorial, working. Then I go to the user service and change the URL of the login: login(user: User) { let headers = new Headers(); headers.append("Content-Type", "application/json"); return this.http.post( "http://ws.u-vox.com/api/noauth/loginvenue", JSON.stringify({ username: user.email, password: user.password, }), { headers: headers } ) .map(response => response.json()) .do(data => { Config.token = data.Result.access_token; }) .catch(this.handleErrors); } handleErrors

Not able to get element's native view in NativeScript

流过昼夜 提交于 2020-01-05 06:28:10
问题 I am trying to change the width of some Switch elements in NativeScript with Angular because they are too small in my opinion. I have found that there is no way to do this through NativeScript's CSS subset so that means I have to make the change to the native object itself. To do this I have added a template reference variable to each one of the switches in my template like this: <Switch #switch checked="false"></Switch> Then in my class I try to access their android and nativeView properties

Sharing JSON data from server between 2 components

自作多情 提交于 2019-12-31 05:15:06
问题 I posted this yesterday but I have changed so much of the code today I have basically re-written my question: I have a NativeScript with Angular app using the TabView template and a login form using a modal window over the tabs initially and this appears to be working OK - the login form has no tabs and when logged in I am taken to the TabView. Upon successful login I want to call methods within the tabbed components and update the respective templates with content specific to the logged in

Nativescript AutoComplete not visible

送分小仙女□ 提交于 2019-12-25 09:43:57
问题 Do any have the latest working solution for Autocomplete? I tried above steps but nothing is visible on screen Appreciate your answer and help! I tried this steps but nothing worked or visible on screen... The array of items: var item:Array<string> = ['1','2','3','4'] and in the HTML of the component: <StackLayout> <AutoComplete [items]="item" itemTap="itemTapped($event)"> </AutoComplete> </StackLayout> -Regards 回答1: I have been able to create something, It's not a plugin, just a piece of

NativeScript Angular 2 disable swipe back on ios

╄→гoц情女王★ 提交于 2019-12-25 04:26:36
问题 does anyone know how to disable the back swipe after navigating to a new page? I read this: http://docs.nativescript.org/angular/core-concepts/angular-navigation#clearing-page-navigation-history Clearing Page Navigation History In NativeScript's page navigation, you have the option to navigate to another page and clear the page navigation history. This means that the user will not be able to go back using the back button (or swipe back in iOS). This is useful in scenarios where you have a