angular2-nativescript

Angular/Nativescript: Listview doesn't show at all

拥有回忆 提交于 2019-12-12 04:25:37
问题 I am busy with a very basic Angular2/Nativescript app where i'm trying to replicate a table from a web app where I display stock transactions using Nativescript's GridLayout and ListView... i'm not sure there's a way to add all content in the ListView and not have the table headers repeat with in every item in the ListView so i've created two GridLayouts, one at the top and one contained in the ListView... When I click on the show stock transactions button the ListView doesn't show at all.

NativeScript tap & longPress together not working

為{幸葍}努か 提交于 2019-12-12 03:36:05
问题 On longPress event the tap event also executing <StackLayout (longPress)="onLongPressItem(item)" (tap)="onItemTap(item)">...</StackLayout> is there a way to prevent tap on longPress? I want to work both events on Same layout. In ListView we have 'itemTap' only is there a option for 'longPress'? Please don't suggest me RadListView. 回答1: Maybe this answer is still helpful too. There exists issues concerning your problem: https://github.com/NativeScript/NativeScript/issues/2823 https://github

RadListView itemTap produces “Calling js method onItemClick failed” error page

浪子不回头ぞ 提交于 2019-12-11 18:24:40
问题 I have a RadListView showing a list of items loaded from server. I want to tap on a single item and go to the detail page. I keep getting the same black error page when I tap anywhere on the listing. Here is the component that populates it. import { RadListView, ListViewEventData } from "nativescript-ui-listview"; ... ... public onListLoaded(args: ListViewEventData) { this.updateService.getReports() .subscribe( (data) => { console.log("report data in reports component onListLoaded = "+JSON

Filtering an observable in Angular/Nativescript

做~自己de王妃 提交于 2019-12-11 14:32:50
问题 Currently, I'm trying to build an app which retrieves an obserable, which you can then sort and/or filter in some predefined ways. Retrieving and sorting the data works fine: sort.service.ts import { Injectable } from "@angular/core" import { HttpClient, HttpErrorResponse } from "@angular/common/http" import { Observable } from "rxjs/Observable"; import { Subscriber } from "rxjs"; import "rxjs/add/operator/catch"; import "rxjs/add/operator/do"; import "rxjs/add/operator/map"; import {

Nativescript fs module not seeing folder or files

六眼飞鱼酱① 提交于 2019-12-11 12:54:24
问题 I'm using the Nativescript tutorial for creating a carousel here. The problem I'm running into is that I get the following error (minus my obfuscation) Error: Failed to load component from module: undefined.xml or file: /data/data/{Obfuscated}/files/app/pages/welcome/slides/slide1.xml when it tries to load xml files on this line (full snippet below): slides.push(builder.load(slidePath)) Upon some inspection I found that it's the file system that doesn't see the files I'm loading. My code is

How to use events in Nativescript ExoPlayer?

笑着哭i 提交于 2019-12-11 08:42:36
问题 Link to player: https://github.com/nstudio/nativescript-videoplayer I am using exoplayer in my nativescript project. I want to call a function when the player is ready to play the video. The documentation of this plugin is little bit unclear but player events are mentioned there: Event Description ------------------------------------------------- errorEvent This event fires when an error in the source code is thrown. playbackReadyEvent This event fires when the video is ready.

How to parse this json structure in listview angular2 nativescript

怎甘沉沦 提交于 2019-12-11 08:06:22
问题 json structure : { "Employee": [ {"id":1,"name":"Dan" }, {"id":2,"name":"Stack" }, ..... ] } app.component.ts: ngOnInit() { console.log("first", "Test"); this.globalReader.getObjectData() .subscribe(data => this.getData = JSON.stringify(data), ---> Response printed successfully here.I'm able to print it in label. error => alert(error), () => console.log("finished") ); } Edit: component: <label text ="{{getData }}" ></label> getObjectData() { return this._http.get('/page/emp.json') .map(

What could cause a promise to fail in Nativescript angular2?

孤者浪人 提交于 2019-12-11 06:14:22
问题 I am trying to Http GET from a database , where I do have access and can reproduce the GET result in Postman. I have created a service in angular2 {N} where I execute this GET but I get an error of : JS: EXCEPTION: Error: Uncaught (in promise): Response with status: 200 for URL: null JS: STACKTRACE: JS: Error: Uncaught (in promise): Response with status: 200 for URL: null JS: at resolvePromise (/data/data/org.nativescript.ndemo/files/app/tns_modules/zone.js/dist/zone-node.js:496:32) JS: at

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 {

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" >