nativescript-angular

NativeScript Angular Cleartext HTTP traffic to localhost not permitted

情到浓时终转凉″ 提交于 2020-03-03 12:47:07
问题 I am working with angular version of native script and trying to create a login system to my network. Below is my code that attempts to log into the network. home.component.ts import { LoginService } from '../Services/login/login.service'; export class LoginComponent implements OnInit { public user: User; loginForm: FormGroup; constructor(private router: Router, private userService: UserService, private page: Page, public loginDetails: LoginDetails, private LoginService: LoginService ) { this

Unit testing Nativescript application logic on a browser

删除回忆录丶 提交于 2020-02-04 22:16:44
问题 I am trying to set up unit testing for a Nativescript application, run by ng test on a browser. The problem is that whenever there is a tns-core-modules or another plugin import, the module cannot be resolved because of the platform specific files (e.g. "tns-core-modules/application/application.android.js") that never get compiled into the bundle, thus throwing an error like "Module not found: Error: Can't resolve 'tns-core-modules/application'". I know there is a built-in unit test support

Model class from another path throws error calling module in NativeScript

…衆ロ難τιáo~ 提交于 2020-01-14 05:36:08
问题 I had a web application which worked perfectly and then migrated it with NativeScript into a mobile application. I have a model file in src/app/model , where I have inside some class model exported like this: export class User { username: string; password: string; } I am trying to import that class model to a service class. My service class path is src/app/auto-generated/service . When I am importing it, the app does not work. But when I am creating the same class model in the src/app/auto

Not able to get element's native view in NativeScript

流过昼夜 提交于 2020-01-05 06:28:10
问题 I am trying to change the width of some Switch elements in NativeScript with Angular because they are too small in my opinion. I have found that there is no way to do this through NativeScript's CSS subset so that means I have to make the change to the native object itself. To do this I have added a template reference variable to each one of the switches in my template like this: <Switch #switch checked="false"></Switch> Then in my class I try to access their android and nativeView properties

How to ignore accessibility fonts resize in NativeScript?

不打扰是莪最后的温柔 提交于 2020-01-05 05:32:46
问题 I'm using NativeScript with Angular. Is there an attribute to specify on Labels/buttons to ignore the font increase due to accessibility settings? I need a solution for both android and ios. Thank you! 回答1: If anybody interested, I found a workaround of using FormattedString for Labels, this object does not scale. 回答2: I just had a look a NativeScript own code and noticed this: https://github.com/NativeScript/NativeScript/blob/master/tns-core-modules/ui/text-base/text-base.android.ts#L216 You

Nativescript using custom icons on NavigationButton

时光总嘲笑我的痴心妄想 提交于 2019-12-25 09:30:14
问题 I'm trying to add a button with custom fonts on the ActionBar on a NativeScript Angular app. This is what I tried so far: <ActionBar class="cp-icon"> <NavigationButton text="" (tap)="goBack()"></NavigationButton> <Image src="res://logo_h_white"></Image> </ActionBar> // Or one of these optio <ActionItem text="" (tap)="goBack()"></ActionItem> <Label text=""></Label> <Button text=""></Button> But none of them seems to be working. I do have the font instaled because I can use in the view.

Create NativeScript Plugin using IOS Static Library issue

a 夏天 提交于 2019-12-24 22:32:16
问题 I have created .a static library (tested in Xcode for native ios project and Its working fine) Now I am following this https://github.com/NativeScript/nativescript-plugin-seed to create nativescript plugin using .a static framework. Plugin structure module.modulemap file is created by me and it's look like this module libstaticlibrary { umbrella header "staticlibrary.h" export * } staticlibrary.h #import <Foundation/Foundation.h> @interface staticlibrary : NSObject + (NSString *)sayHello;

How to access android's R object in NativeScript?

拥有回忆 提交于 2019-12-24 21:34:25
问题 I am trying to access android's R object in NativeScript with Angular but I haven't had any success. The instructions here say to do it like this: android.R.color.holo_purple But when I try to import the android variable from the application module or the tns-core-modules/platform module I get an error that the R property on the android object is undefined. How do I get access to R ? 回答1: you don't need to import android variable from application module. it is automatically available by

Different release & debug config in a nativescript app

蓝咒 提交于 2019-12-24 19:14:25
问题 I've created 2 files: "config.debug.ts" & "config.release.ts". My understanding is that NativeScript's build script should copy the appropriate file to "config.ts" during the build. And then I should be able to do something like "import { config } from './config'" from my other *.ts files. That however does not happen and I'm getting a compilation error when doing "tns run". Now, I'm in doubt if I'm doing this properly at all.. What is the "true NS" way to have different configs for debug &

NativeScript tns build failed after adding nativescript-ui-dataform plugin

我只是一个虾纸丫 提交于 2019-12-24 11:08:42
问题 I added plugin nativescript-ui-dataform to my project with command, tns plugin add nativescript-ui-dataform I checked package.json after install and noticed "nativescript-ui-dataform": "^3.10.0" was added to the project. When I build project with tns build android , I get following exception, Exception in thread "main" java.lang.ClassNotFoundException: Class: com.telerik.widget.autocomplete.ShowSuggestionListListener at org.nativescript.staticbindinggenerator.Generator.getClass(Generator.java