nativescript

Nativescript Switch not to fire initial binding

江枫思渺然 提交于 2019-12-11 04:53:13
问题 My view is <Switch checked="{{ active }}" propertyChange="onCheckChange"/> exports.onCheckChange = function(args) { //Api Service call } Actually I am binding the active value by API call and the issue is that onCheckChange gets executed during the initial binding with false value, so whenever I initially set the active==true by api service call and load the page, the onCheckChange is executed with checked==false , can anyone give me an idea about this please. Note: Beginner in Nativescript

NativeScript ng2 two way binding doesn`t work on TextField

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 04:25:55
问题 im making a mobile app. In my login form i have 2 TextFields <TextField hint="Email Address" keyboardType="email" [(ngModel)]="email" autocorrect="false" autocapitalizationType="none"></TextField> <TextField hint="Password" secure="true" [(ngModel)]="password"></TextField> <Label [text]="email"></Label> in component.ts import { Component, OnInit } from '@angular/core'; import { Router } from "@angular/router"; import { NativeScriptRouterModule } from "nativescript-angular/router"; import {

How to show and bind base64 string to Image as a source in Nativescript?

两盒软妹~` 提交于 2019-12-11 04:23:54
问题 I am trying to show and bind base64 image as ImageSource in my View, but it does not show up at all. I couldn't find any helpful information on this in documentation .. am I doing something wrong? imageSource is property that should hold Image src data .. Here is the View: <Page loaded = "loaded" xmlns = "http://schemas.nativescript.org/tns.xsd" > <StackLayout> <TextField hint = "String for encoding!" text = "{{ message }}" /> <Button tap = "{{ onGenerateQrTap }}" text = "Generate QR" class =

How we can hide or show RadDataForm fields dynamically in Typescript?

笑着哭i 提交于 2019-12-11 04:18:48
问题 I am working on Nativescript+angular application and using RadDataForm. Here is my example code. <RadDataForm (propertyValidate)="onPropertyValidate($event)" row="0" tkExampleTitle tkToggleNavButton #myDataForm [source]="person" [metadata]="personMetadata"></RadDataForm> I am creating the form with "Json" file. { "isReadOnly": false, "commitMode": "Immediate", "validationMode": "Immediate", "propertyAnnotations": [ { "name": "insurance_name", "displayName": "Insurance Name", "index": 0,

NativeScript error. More than one view found in list template

落爺英雄遲暮 提交于 2019-12-11 03:53:49
问题 I had such ListView <ListView [items]="groceryList" row="1" class="small-spacing" [class.visible]="listLoaded"> <template let-item="item" columns="*, auto" > <Label [text]="item.name" class="medium-spacing"></Label> </template> </ListView> I want to add image button. So I just added columns="*, auto" to template and col="0" to Label and col="1" to my Image <ListView [items]="groceryList" row="1" class="small-spacing" [class.visible]="listLoaded"> <template let-item="item" columns="*, auto" >

Nativescript builds old code

醉酒当歌 提交于 2019-12-11 03:37:38
问题 I have angular 2 nativescript project and I use tns livesync android --watch or tns run android to see changes on both real device and emulator. It usually works fine but at some point it starts building and syncing old code and throws JS errors based on that code. It's usually solvable by reseting the whole project (remove platforms, node-modules, hooks) and tns install everything back. When I add new node modules and/or new custom components, I usually kill the lifesync and do the tns build

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

tns run android --emulator not working - NativeScript

允我心安 提交于 2019-12-11 02:23:59
问题 I have followed the steps in this link. When I run using the command tns run android --emulator , I got the following error in command prompt Configuring > 0/4 projects > root projectError: read ECONNRESET at exports._errnoException (util.js:890:11) at TCP.onread (net.js:552:26) Following is the error screenshot for your reference. Can someone help me to solve this issue? Thanks in advance. 回答1: I have fixed this issue by updating tns-core-modules using the command npm install tns-core

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

Using nativescript converters

China☆狼群 提交于 2019-12-11 01:40:00
问题 Im just now trying to get my hooks into nativescript with javascript and have a very basic question: let costFormatter= { toView(value){ console.log('Got:' + value); return '$' + value; }, toModel(value){ console.log('Got:' + value); return '$' + value; } }; http.getJSON("<My API Call>").then(function (r){ page.bindingContext = { deals: r, costFormatter:costFormatter }; }, function (e){ //// Argument (e) is Error! //console.log(e); }); In the above code, I define the cost formatter I just