nativescript

Nativescript Stuck at Copying template files

99封情书 提交于 2019-12-24 05:59:39
问题 I have a NativeScript + angular project it was working fine until i upgraded my cli to 7.0.3 now i can't run the following : tns run android --bundle because it get stuck at : Webpack compilation complete. Watching for file changes. Webpack build done! Copying template files... I've tried to wait more than an hour all it created was platform folder with android and temp-android and not the complete project it use to generate my environment is currently like this when i run ng --version from

Nativescript Stuck at Copying template files

北战南征 提交于 2019-12-24 05:59:06
问题 I have a NativeScript + angular project it was working fine until i upgraded my cli to 7.0.3 now i can't run the following : tns run android --bundle because it get stuck at : Webpack compilation complete. Watching for file changes. Webpack build done! Copying template files... I've tried to wait more than an hour all it created was platform folder with android and temp-android and not the complete project it use to generate my environment is currently like this when i run ng --version from

No provider for Store! Error at injectionError

倾然丶 夕夏残阳落幕 提交于 2019-12-24 01:53:40
问题 app.component.html <page-router-outlet></page-router-outlet> app.component.ts import 'rxjs/add/operator/let'; import { Component, ViewEncapsulation } from '@angular/core'; import { EchoesState, getSidebarCollapsed$ } from './core/store'; import { Store } from '@ngrx/store'; @Component({ selector: "ns-app", templateUrl: "app.component.html", }) export class AppComponent { constructor(private store: Store<EchoesState>){} } app.module.ts import 'nativescript-localstorage'; import { NgModule, NO

Nativescript image to Base64 then fetch POST

社会主义新天地 提交于 2019-12-24 00:57:26
问题 How can I Base64 an image so it would be suitable to send with nativescript fetch module? 回答1: Here is a basic demo for your case using test server "use strict"; var imageSourceModule = require("image-source"); function navigatingTo(args) { var page = args.object; // using icon.png from the template app from res://icon var imgSrc = imageSourceModule.fromResource("icon"); var imageAsBase64 = imgSrc.toBase64String("PNG"); fetch("https://httpbin.org/post", { method: "POST", headers: { "Content

How to convert existing NativeScript Angular project to Code Sharing project

╄→гoц情女王★ 提交于 2019-12-24 00:56:25
问题 All available tutorials talk about converting Angular Web Apps to codesharing Nativescript projects. I want to do the opposite. I almost finished coding the mobile app with Nativescript and now I wanna make the Web App with the code sharing in between both. 回答1: I did almost the same a couple of days ago, and while not exactly standard, my approach has been: create a new shared web/mobile project from scratch. move angular components from the mobile-only project to the shared project. rename

How to create a floating help layout?

早过忘川 提交于 2019-12-24 00:46:22
问题 I've got a {N} page and conditionally I'd like to create a floating bubble text label pointing to certain features on the page. e.g. "Press START button to blah". Any help on how this could be done. Preferably w/o modifying the xml page files. 回答1: I released a plugin that can do what you are requesting simply install it tns plugin add nativescript-tooltip then you can use it as follows TypeScript import * as frame from "ui/frame"; import {ToolTip} from "nativescript-tooltip"; new ToolTip

Nativescript imagepicker .getImage() is not a function error

天大地大妈咪最大 提交于 2019-12-24 00:38:10
问题 I have been trying to implement the answer to this question but keep getting the error "selected.getImage is not a function". I have tried multiple different code examples at this point and I'm stumped. It seems like this is a type error, but I'm not sure where I can correct this. I am looking to select a single image and return the path to that image in order to upload to the server. I don't need to display it on the device, though that is an option I suppose. Seems easy enough, but

NativeScript vue, vuex and urlhandler

自古美人都是妖i 提交于 2019-12-23 23:43:24
问题 Edit I'm using https://github.com/hypery2k/nativescript-urlhandler to open a deep link within my app - using NativeScript vue, and vuex. It seems that in order to get at the methods needed to do routing [ $navigateTo etc] this plugin needs to be set up slightly differently from the examples given in docs. import Vue from "nativescript-vue"; import Vuex from "vuex"; Vue.use(Vuex); import { handleOpenURL } from 'nativescript-urlhandler'; new Vue({ mounted() { handleOpenURL( (appURL) => {

Using Angular libraries in Nativescript code sharing project

时间秒杀一切 提交于 2019-12-23 19:55:02
问题 I'm trying to migrate an Angular app to a shared codebase with Nativescript using the new @nativescript/schematics , however, I'm having problems importing my Angular library when building the mobile version of the app. I used the angular-cli to create the library ( ng generate library ). For the web version, all I had to do was build the library separately using ng build library-name which then allowed me to import it into the main application. How can I build a mobile version of the library

Refresh a ListView adding new elements on runtime in NativeScript and Angular

强颜欢笑 提交于 2019-12-23 12:37:16
问题 I'm building a ListView based component, similar to the groceries example in the {N} page. I have a "+" button, that needs to add new items to the list, I have this code: import { Component, OnInit } from '@angular/core'; @Component({ moduleId: module.id, selector: 'my-list', templateUrl: 'my-list.component.html' }) export class ListComponent implements OnInit { private myList: CustomObject; constructor() { } ngOnInit() { } addItem(){ this.myList.push(new CustomObject()); } } And here is the