angular2-nativescript

NativeScript: toggleDrawerState not a function error

非 Y 不嫁゛ 提交于 2019-12-11 03:12:04
问题 I'm trying to create a sample application in native script. I used RadSideDrawer for sidemenu in the following way by referencing http://docs.telerik.com/devtools/nativescript-ui/Controls/Angular/SideDrawer/getting-started : <RadSideDrawer [transition]="RevealTransition" #drawer> <StackLayout tkDrawerContent class="sideStackLayout"> <StackLayout class="sideTitleStackLayout"> <Label text="Navigation Menu"></Label> </StackLayout> <StackLayout class="sideStackLayout"> <Label text="Primary" class

NativeScript: Way to disable zoom controls for iOS WebView?

北战南征 提交于 2019-12-11 01:44:06
问题 I am trying to figure out a way to prevent users from zooming in and out on an iOS WebView (tns-ios 3.4.1) via pinch gestures & double tapping, essentially disabling all scaling like the html meta tag used to do before apple went to letting the user decide if he wants to zoom with iOS 10 and above. I found a solution for android here, for iOS it doesn't appear to be as trivial though. I am pretty new to the platform, is this currently possible at all? I found that NS recently switched from

Nativescript Switch prevent change event firing on initial binding

混江龙づ霸主 提交于 2019-12-10 21:05:44
问题 Hi my template is something like the below <ListView [items]="modules"> <template let-item="item" > <StackLayout orientation="vertical"> <Switch (checkedChange)="onSwitchModule(item.id,$event)" [checked]="item.active"></Switch> </StackLayout> </template> </ListView> My controller is ngOnInit() { this._moduleService.getUserModules() .subscribe( response=>{ this.modules = response.data; } ) } onSwitchModule(itemId) { console.log(itemID); //Gets called on initial true binding on switch checked }

Make Telerik Sidedrawer in all Views

微笑、不失礼 提交于 2019-12-10 15:37:06
问题 I've successfully got the Telerik Side-drawer working in one view, but I'm stuck with making it into a component I can use globally. I'd like to avoid copy and pasting it into every view, so my question is how can I turn it into a reusable component. 回答1: So when you use the page-router-outlet Do not modify the main app template <page-router-outlet></page-router-outlet> - you might feel otherwise but its fine (the way the page router outlet works would add the side drawer only to the main

What is alternative of DIV in NativeScript?

99封情书 提交于 2019-12-10 12:25:09
问题 What is alternative of DIV in NativeScript? How to use block inline with content inside? 回答1: Within Browser the behaviour div is determined by display CSS attribute. For example, by default it's block and vertical which is similar to StackLayout with orientation set to vertical . When you make it inline , that's more like a horizontal layout, so again could be StackLayout with orientation set to horizontal . There is again flex , we also have an equivalent in NativeScript, the FlexboxLayout

Nativescript RadDataForm MultilineText not working on Android

不想你离开。 提交于 2019-12-10 11:53:13
问题 I am using RadDataForm in my Nativescript Angular project and when I try to use "MultilineText" it doesn't work on Android, it just appears as a normal "Text" box. I am not able to enter multiple lines. Works fine on iOS. add-store.model.ts export class AddStore { public name: string; public description: string; constructor(name: string, description: string,) { this.name = name; this.description = description; } } add-store-metadata-validation.json { "isReadOnly": false, "commitMode":

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

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

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