NativeScript error. More than one view found in list template

Issue 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″

Continue reading

Nativescript angular 2 component how to?

Issue How do i implement a component like a element directive in angular 1? This is my code but it doesn’t work: import {Component} from “@angular/core”; @Component({ moduleId: “TestComponent”, selector: “TestComponent”, template: ‘<Label text=”TEST COMPONENT” textWrap=”true”></Label>’ }) export class TestComponentComponent

Continue reading

NativeScript Telerik UI RC6

Issue After Angular RC6 upgrade I can’t get the application running (builds fine). It seems the culprit is nativescript-telerik-ui library. Throws following error: java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Error calling module function SyntaxError: Unexpected token export File: “<unknown>,

Continue reading

NativeScript: toggleDrawerState not a function error

Issue 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”

Continue reading

Unable to find stylesheets in multiples nativescript styleurls

Issue I’m using nativescript-angular 1.2.0 and tns-core-modules 2.5.0. Here my login.component.ts: @Component({ moduleId: module.id, selector: “myapp”, templateUrl: “./login.component.html”, styleUrls: [“./login.common.css”, “./login-component.android.css”] }) But while compiling it is unable to find login-component.android.css. I’ve already remove, build, add etc. I change the

Continue reading

In NativeScript with Angular2 get element value

Issue I have a list, and I want to get the value of the list item. The view is as follows <ListView [items]=”myItems” (itemTap)=”onItemTap($event)”> <template let-item=”item” let-i=”index” let-odd=”odd” let-even=”even”> <StackLayout [class.odd]=”odd” [class.even]=”even”> <Label #myFoo id=”grocery-list” [text]='”Value is: ” + i’></Label>

Continue reading

nsRouterLink is not working in nativescript

Issue I need to navigate from one page to another in nativescript(android). I tried in my tns.html <Button [nsRouterLink]=”[‘/grocery’, ‘list’]” class=”btn btn-primary btn-rounded-lg” text=”Back”></Button> routes.ts export const RootRoutes: Array<any> = [ { path: ”, component: RootComponent }, { path: ‘grocery/:type’,

Continue reading

Cannot access native api (iOS or Android) using NativeScript + Angular-2 project

Issue How to replicate: tns create Something –ng cd Something now following this link https://docs.nativescript.org/angular/core-concepts/accessing-native-apis-with-javascript.html npm install tns-platform-declarations –save-dev replaced contents of tsconfig.json and reference.d.ts tns run iOS I’m getting file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:18646:26: JS ERROR Error: Can’t resolve all parameters for ItemsComponent:

Continue reading

Native script list template binding not working

Issue I cannot make working binding with ListView and template. <ListView #userListView [items]=”usersViewList” (itemTap)=”onItemTap($event)”> <template let-user=”item” let-i=”index”> <GridLayout columns=”auto”> <Label [text]=”user.name” col=”0″></Label> </GridLayout> </template> </ListView> at cration time user.name is assigned properly, but later if I call. user.name = “other

Continue reading

NativeScript custom component not showing when using @wwwalkerrun/nativescript-ngx-magic

Issue I create a new test app > ng new TestApp Then I install the nativescript-ngx-magic > npm i @wwwalkerrun/nativescript-ngx-magic –save Then create a new app.component.tns.html <ActionBar title=”Magic!” icon=”” class=”action-bar”> </ActionBar> <StackLayout class=”p-20″> <Label text=”NativeScript is Neat.” class=”h1 text-center”></Label> </StackLayout>

Continue reading

Nativescript-ui Radlistview Null pointer error

Issue Radlistview not rendering the source array. Please help me figure out where I’m going wrong.This is giving me null pointer exception. I have included the code in the section below. srtdetails.component.html <GridLayout tkExampleTitle tkToggleNavButton> <RadListView [items]=”source”> <template tkListItemTemplate let-item=”item”>

Continue reading

Error: ActionItem is not a valid View instance

Issue I have the following template: <Page.actionBar> <ActionBar title=”Modules” automationText=”ActionBar”> <NavigationButton icon=”res://back_btn” tap=”goBack” automationText=”GoBack”></NavigationButton> <Android> <ActionItem id=”exampleMenuButton” icon=”res://menu” automationText=”ExampleMenu”></ActionItem> </Android> <iOS> <ActionItem id=”exampleMenuButton” ios.position=”right” automationText=”ExampleMenu”> <ActionItem.actionView> <Image src=”res://menu” width=”22″ height=”22″ margin=”0, -11, 0, 11″></Image> </ActionItem.actionView> </ActionItem> </iOS> </ActionBar> </Page.actionBar> Which

Continue reading

NativeScript : First call of getPlatformData without providing projectData

Issue I’ve been seeing this for the last couple of days – Project successfully prepared (android) Executing after-prepare hook from C:\App\mobile-app\hooks\after-prepare\nativescript-dev-android-snapshot.js Executing after-prepare hook from C:\App\mobile-app\hooks\after-prepare\nativescript-dev-sass.js First call of getPlatformData without providing projectData. So far, I’ve tried th following –

Continue reading

How can I make a StackLayout with ngFor loop into scrollable list?

Issue <StackLayout width=”100%” *ngFor=”let item of (videos$ | async)”> <CardView class=”studentCard” margin=”2″ elevation=”10″ radius=”1″> <GridLayout rows=”auto, auto, auto” columns=”auto, auto, *”> <Image [src]=”item.snippet.thumbnails.high.url” stretch=”aspectFill” colSpan=”3″ row=”0″></Image> <Label [text]=”item.snippet.channelTitle” textWrap=”true” row=”2″ colSpan=”1″ ></Label> <Label [text]=”item.snippet.title” textWrap=”true” row=”2″ col=”1″ colSpan=”2″ >></Label> </GridLayout>

Continue reading