Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
android:icon="@drawable/icon"
android:usesCleartextTraffic="${isUnitTesting}"
android:label="@string/app_name"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
android:networkSecurityConfig="@xml/network_security_config">

<activity
android:name="com.tns.NativeScriptActivity"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" />
<certificates src="user" />
</trust-anchors>
</base-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">localhost</domain>
<domain includeSubdomains="true">127.0.0.1</domain>
<domain includeSubdomains="true">10.0.2.2</domain>
</domain-config>
</network-security-config>


8 changes: 4 additions & 4 deletions apps/nativescript-demo-ng/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"@nativescript/core": "file:../../node_modules/@nativescript/core"
},
"devDependencies": {
"@nativescript/android": "~8.9.0",
"@nativescript/ios": "~8.9.0",
"@nativescript/android": "~9.0.0",
"@nativescript/ios": "~9.0.0",
"@nativescript/tailwind": "^2.1.0",
"@nativescript/unit-test-runner": "^3.0.1",
"@nativescript/visionos": "~8.9.0"
"@nativescript/unit-test-runner": "^4.0.0",
"@nativescript/visionos": "~9.0.0"
}
}
6 changes: 4 additions & 2 deletions apps/nativescript-demo-ng/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"uglify": false,
"release": false,
"forDevice": false,
"prepare": false
"prepare": false,
"flags": "--env.commonjs"
},
"dependsOn": ["^build"]
},
Expand All @@ -53,7 +54,8 @@
"executor": "@nativescript/nx:test",
"outputs": ["{workspaceRoot}/coverage/apps/nativescript-demo-ng"],
"options": {
"coverage": false
"coverage": false,
"flags": "--env.commonjs"
},
"configurations": {}
}
Expand Down
5 changes: 2 additions & 3 deletions apps/nativescript-demo-ng/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import {
provideNativeScriptRouter,
runNativeScriptAngularApp,
} from '@nativescript/angular';
import { Trace } from '@nativescript/core';
import { Trace, Utils } from '@nativescript/core';

// import { AppModule } from './app/app.module';
import { withInterceptorsFromDi } from '@angular/common/http';
import { setWindowBackgroundColor } from '@nativescript/core/utils/ios';
import { AppComponent } from './app/app.component';
import { routes } from './app/app.routes';
import { provideZonelessChangeDetection } from '@angular/core';
Expand All @@ -22,7 +21,7 @@ Trace.setCategories('ns-route-reuse-strategy,ns-router');
runNativeScriptAngularApp({
appModuleBootstrap: () => {
if (__APPLE__) {
setWindowBackgroundColor('#a6120d');
Utils.ios.setWindowBackgroundColor('#a6120d');
}
return bootstrapApplication(AppComponent, {
providers: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe('Platform filter directives', () => {
fixture.detectChanges();
const componentRef = fixture.componentRef;
const componentRoot = componentRef.instance.elementRef.nativeElement;
expect(dumpView(componentRoot, true).indexOf('(label[text=Apple])') >= 0).toBe(true);
expect(dumpView(componentRoot, true).indexOf('(label[text=Apple])') >= 0).toBe(__APPLE__);
});
it('does not render android specific content', () => {
const fixture = TestBed.createComponent(AndroidSpecificComponent);
Expand Down
11 changes: 9 additions & 2 deletions apps/nativescript-demo-ng/src/tests/value-accessor-tests.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
// make sure you import mocha-config before @angular/core
import { ElementRef } from '@angular/core';
import { CheckedValueAccessor, DateValueAccessor, NumberValueAccessor, SelectedIndexValueAccessor, TextValueAccessor, TimeValueAccessor } from '@nativescript/angular';
import {
CheckedValueAccessor,
DateValueAccessor,
NumberValueAccessor,
SelectedIndexValueAccessor,
TextValueAccessor,
TimeValueAccessor,
} from '@nativescript/angular';
import { DatePicker, ListPicker, Slider, Switch, TextField, TimePicker, View } from '@nativescript/core';

class TestElementRef implements ElementRef {
Expand Down Expand Up @@ -80,7 +87,7 @@ describe('two-way binding via ng-model', () => {
accessor.writeValue(null);
expect(accessor.view.checked).withContext('setting null should reset the value').toBe(defaultValue);

expect(() => accessor.writeValue('blah')).toThrow();
expect(() => accessor.writeValue('blah')).not.toThrow();
});

it('converts strings to dates', () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/nativescript-demo-ng/tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"target": "es2017",
"target": "es2020",
"baseUrl": ".",
"outDir": "../../dist/out-tsc",
"paths": {
Expand Down
2 changes: 1 addition & 1 deletion apps/nativescript-demo-ng/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"target": "es2017",
"target": "es2020",
"baseUrl": ".",
"outDir": "../../dist/out-tsc",
"paths": {
Expand Down
Loading
Loading