angular2-nativescript

How to use nativescript's WebView in angular2?

醉酒当歌 提交于 2019-12-01 08:25:44
问题 I'm trying to insert a web-view on my page and listen the 'loadFinishedEvent'... But for do this, i need to find the webview in my component (ts file), through nativescript way i need to wrap my xml (UI) with a tag: <Page xmlns="http://schemas.nativescript.org/tns.xsd But doing this i got this error: " TypeError: this.page.frame._getNavBarVisible is not a function ", and without the Page tag i've already tried with some ways but with unsuccessful... I do not found any sample of this too, can

NativeScript can't find Android SDK on Mac OS

孤街浪徒 提交于 2019-12-01 00:51:47
I've installed NativeScript and I try to do tns platform add android but it doesn't work. ANDROID_HOME path is correct and I have installed SDK (API 22 and the newest one) and tools (25.0.2). When I run tns doctor it says: WARNING: The Android SDK is not installed or is not configured properly. Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 22 or later. You need to have the Android SDK Build-tools installed on your system. You can install any version in the following range: '>=25.0.2'. You need to have Android SDK 22 or later and the

NativeScript can't find Android SDK on Mac OS

孤街醉人 提交于 2019-11-30 19:24:32
问题 I've installed NativeScript and I try to do tns platform add android but it doesn't work. ANDROID_HOME path is correct and I have installed SDK (API 22 and the newest one) and tools (25.0.2). When I run tns doctor it says: WARNING: The Android SDK is not installed or is not configured properly. Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 22 or later. You need to have the Android SDK Build-tools installed on your system. You can

Angular2: Convert XML to JSON

♀尐吖头ヾ 提交于 2019-11-30 09:16:49
I wanted to convert the XML I received from Web API response to JSON in Angular 2. The application is developed in Nativescript. Not able to find a solution for this. I found an amazing package to make this very simple. xml2js For me on I am doing it in an angular 2 application but on the node side. npm install xml2js --save It is literally as simple as passing the xml like this, var parseString = require('xml2js').parseString; var xml = "<root>Hello xml2js!</root>" parseString(xml, function (err, result) { console.dir(result); }); In my app I had an xml file and used it like this, var fs =

Angular2: Convert XML to JSON

泄露秘密 提交于 2019-11-29 14:10:48
问题 I wanted to convert the XML I received from Web API response to JSON in Angular 2. The application is developed in Nativescript. Not able to find a solution for this. 回答1: I found an amazing package to make this very simple. xml2js For me on I am doing it in an angular 2 application but on the node side. npm install xml2js --save It is literally as simple as passing the xml like this, var parseString = require('xml2js').parseString; var xml = "<root>Hello xml2js!</root>" parseString(xml,

Nativescript accessing localhost access in android and ios

落爺英雄遲暮 提交于 2019-11-29 11:59:41
I have a local node rest api running on my system. My question is ,when accessing localhost from android we are supposed to use 10.0.2.2. And When using ios we can use localhost . So is there a way we can control the host name we call , depending on the environment ios or android in a nativescript app inside JS file you can use following (better when u need quick decide what to use per platform code) /*at top file*/ var platform = require("platform"); var nativePlatformLocalhost; /*in some function or globally*/ if(platform.device.os === platform.platformNames.ios){ /*localhost for ios*/

NativeScript handling back button event

半腔热情 提交于 2019-11-29 07:32:18
I am trying to handle the hardware back button in a NativeScript app. I am using NativeScript version 2.3.0 with Angular. Here is what I have in main.ts file // this import should be first in order to load some required settings (like globals and reflect-metadata) import { platformNativeScriptDynamic, NativeScriptModule } from "nativescript-angular/platform"; import { NgModule,Component,enableProdMode } from "@angular/core"; import { AppComponent } from "./app.component"; import { NativeScriptRouterModule } from "nativescript-angular/router"; import { routes, navigatableComponents } from ".

Nativescript accessing localhost access in android and ios

心不动则不痛 提交于 2019-11-28 06:20:38
问题 I have a local node rest api running on my system. My question is ,when accessing localhost from android we are supposed to use 10.0.2.2. And When using ios we can use localhost . So is there a way we can control the host name we call , depending on the environment ios or android in a nativescript app 回答1: inside JS file you can use following (better when u need quick decide what to use per platform code) /*at top file*/ var platform = require("platform"); var nativePlatformLocalhost; /*in

NativeScript handling back button event

◇◆丶佛笑我妖孽 提交于 2019-11-28 01:18:01
问题 I am trying to handle the hardware back button in a NativeScript app. I am using NativeScript version 2.3.0 with Angular. Here is what I have in main.ts file // this import should be first in order to load some required settings (like globals and reflect-metadata) import { platformNativeScriptDynamic, NativeScriptModule } from "nativescript-angular/platform"; import { NgModule,Component,enableProdMode } from "@angular/core"; import { AppComponent } from "./app.component"; import {

Assertion failure and NSInternalInconsistencyException in NativeScript

假如想象 提交于 2019-11-27 09:53:10
Can anyone help me on this? I am trying to run my NativeScript + Angular app in my iPhone. Terminal Creation Created tns create mysample --ng app, added iOS platform, successfully built with warnings and run time error arising when I tried to run in Xcode. Playground Creation Downloaded NativeScript + Angular app from NativeScriptPlayground , added iOS platform, successfully built with warnings and run time error arising when I tried to run in Xcode. Issue: In both cases, app is successfully installed in my device but when launch screen is launched, then immediately app is getting crashed.