-
-
Notifications
You must be signed in to change notification settings - Fork 240
Closed
Description
Repro:
-
tns create TestApp --ng
-
tns platform add android
-
Change
app.component.ts
to:import {Component, Input} from "@angular/core"; @Component({ selector: "my-app", template: '<Label text="Hello"></Label>' }) export class AppComponent { @Input() numberField: number; // Comment the @Input attribute and you'll // not get an exception @Input() public set NumberProperty(val: number) { } }
-
Run
Expected: the app runs without any problem
Actual: exception:
java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException:
Fail to load module: /data/data/org.nativescript.TestApp/files/app/main.js
TypeError
File: "<unknown>, line: 1, column: 265
StackTrace:
Frame: function:'decorate', file:'/data/data/org.nativescript.TestApp/files/app/tns_modules/reflect-metadata/Reflect.js', line: 76, column: 23
Frame: function:'__decorate', file:'/data/data/org.nativescript.TestApp/files/internal/ts_helpers.js', line: 10, column: 96
Frame: function:'', file:'/data/data/org.nativescript.TestApp/files/app/app.component.js', line: 16, column: 5
Frame: function:'', file:'/data/data/org.nativescript.TestApp/files/app/app.component.js', line: 29, column: 2
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'/data/data/org.nativescript.TestApp/files/app/main.js', line: 4, column: 23
Frame: function:'require', file:'', line: 1, column: 266
at android.app.ActivityThread.handleBindApplica
Turns out that if you @Input()
on a property, you get that exception. If you remove the property or the @Input
, everything works. Also, note that @Input
on a field works fine.
- tns version: 2.0.1
- OS: Win 10
- Emulator: genymotion
Metadata
Metadata
Assignees
Labels
No labels