NativeScript / nativescript-angular

Integrating NativeScript with Angular
http://docs.nativescript.org/angular/tutorial/ng-chapter-0
Apache License 2.0
1.22k stars 241 forks source link

Events emitting is broken in Angular 10 (and 9 as I see) #2253

Closed SergeyMell closed 4 years ago

SergeyMell commented 4 years ago

Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project): tns info ✔ Getting NativeScript components versions information... ✔ Component nativescript has 7.0.8 version and is up to date. ✔ Component @nativescript/core has 7.0.3 version and is up to date. ✔ Component @nativescript/ios has 7.0.0 version and is up to date. ✖ Component @nativescript/android is not installed.

package.json

{
  "name": "@nativescript/template-hello-world-ng",
  "main": "main.js",
  "version": "7.0.2",
  "author": "NativeScript Team <oss@nativescript.org>",
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "publishConfig": {
    "access": "public"
  },
  "keywords": [
    "nativescript",
    "mobile",
    "angular",
    "{N}",
    "template"
  ],
  "repository": "<fill-your-repository-here>",
  "bugs": {
    "url": "https://github.com/NativeScript/NativeScript/issues"
  },
  "scripts": {
    "ngcc": "ngcc --properties es2015 module main --first-only",
    "postinstall": "npm run ngcc"
  },
  "dependencies": {
    "@angular/animations": "~10.1.0",
    "@angular/common": "~10.1.0",
    "@angular/compiler": "~10.1.0",
    "@angular/core": "~10.1.0",
    "@angular/forms": "~10.1.0",
    "@angular/platform-browser": "~10.1.0",
    "@angular/platform-browser-dynamic": "~10.1.0",
    "@angular/router": "~10.1.0",
    "@nativescript/angular": "~10.1.0",
    "@nativescript/core": "~7.0.0",
    "@nativescript/theme": "~2.3.0",
    "reflect-metadata": "~0.1.12",
    "rxjs": "^6.6.0",
    "zone.js": "~0.11.1"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~10.1.0",
    "@nativescript/ios": "7.0.0",
    "@nativescript/types": "~7.0.0",
    "@nativescript/webpack": "~3.0.0",
    "@ngtools/webpack": "~10.1.0",
    "typescript": "~3.9.0"
  },
  "private": "true",
  "readme": "NativeScript Application"
}

Describe the bug After any navigation events like focus or blur stop emitting.

To Reproduce Run my sample project. Tap between text fields. Navigate to next page. Tab between text fields again. See for the logs. (All the instruction you can also find in the ReadMe.md)

Expected behavior All events are emitted regardless of my navigation

Sample project https://github.com/SergeyMell/nativescript-ivy-issue

Additional context I think the problem is related to ivy rendered. On Angular9 it can be fixed either by disabling Ivy or removing wrapper around page-router-outlet

edusperoni commented 4 years ago

@SergeyMell This should be fixed with 10.1.4. Can you try it?

SergeyMell commented 4 years ago

@edusperoni Actually retested on 10.1.6 and can confirm that it works correctly now