NativeScript / nativescript-datetimepicker

Plugin with date and time picking fields
Apache License 2.0
27 stars 26 forks source link

Got error when call datetimepicker from a modal dialog #72

Open svmashok opened 4 years ago

svmashok commented 4 years ago

Hi

Android Angular 9 version

Hi when i implement datetimepicker in a modal dialog then i got the following error

ERROR Error: Uncaught (in promise): Error: Modal content has more than one root view. JS: Error: Modal content has more than one root view. JS: at new ZoneAwareError (file: apps\xxxxx\src\webpack:\d:\Project Workspace\node_modules\@nativescript\angular\zone-js\dist\zone-nativescript.js:1298:0) JS: at file: apps\xxxxx\src\webpack:\d:\Project Workspace\node_modules\@nativescript\angular\directives\dialogs.js:92:0 JS: at ZoneDelegate.push.../../../node_modules/@nativescript/angular/zone-js/dist/zone-nativescript.js.ZoneDelegate.invoke (file: apps\xxxxx\src\webpack:\d:\Project Workspace\node_modules\@nativescript\angular\zone-js\dist\zone-nativescript.js:388:0) JS: at Object.onInvoke (file: apps\xxxxx\src\webpack:\d:\Project Workspace\node_modules\@angular\core\fesm5\core.js:27859:0) JS: at ZoneDelegate.push.../../../node_modules/@nativescript/angular/zone-js/dist/zone-nativescript.js.ZoneDelegate.invoke (file: apps\xxxxx\src\webpack:\d:\Project Workspace\node_modules\@nativescript\angular\zone-js\dist\zone-nativescript.js:387:0) JS: at Zone.push.../../../node_modules/@nativescript/angular/zone-js/dist/zone-nativescript.js.Zone.run (file: apps\xxxxx\src\webpack:\d:\Project Workspace\node_modules\@nativescript\angular\zone-js\dist\zone-nativescript.js:138:0) JS: at file:///data/data/org.nativ...

any idea?

rigor789 commented 4 years ago

@svmashok plese don't tag people like that, unless of course you want to annoy people. Instead open the issue like normal, and provide as much details as possible:

svmashok commented 4 years ago

Hi @rigor789

Sorry. I thought that those all are involved in this plugin development. Its my misunderstanding. Soon I will update it with my necessary information as you mentioned. Thanks for the reply.

svmashok commented 4 years ago

I have added in the plugin module file

import { NativeScriptDateTimePickerModule } from "nativescript-datetimepicker/angular";

and added

@NgModule({ imports: [ .... NativeScriptDateTimePickerModule ]

From the main page i have opened a popup and inside that popup i need to get the input of date from calendar and set into an label

sample-dialog.component.tns.html < DateTimePickerFields hintDate="select date" hintTime="select time">

But when i open the sample dialog dialog then the following error is shown

ERROR Error: Uncaught (in promise): Error: Modal content has more than one root view. JS: Error: Modal content has more than one root view. JS: at new ZoneAwareError (file: apps\oxseco\src\webpack:\d:\Project Workspace\gcr_oxseco\oxs-frontend-mobile\node_modules\@nativescript\angular\zone-js\dist\zone-nativescript.js:1298:0) JS: at file: apps\oxseco\src\webpack:\d:\Project Workspace\gcr_oxseco\oxs-frontend-mobile\node_modules\@nativescript\angular\directives\dialogs.js:92:0 JS: at ZoneDelegate.push.../../../node_modules/@nativescript/angular/zone-js/dist/zone-nativescript.js.ZoneDelegate.invoke (file: apps\oxseco\src\webpack:\d:\Project Workspace\gcr_oxseco\oxs-frontend-mobile\node_modules\@nativescript\angular\zone-js\dist\zone-nativescript.js:388:0) JS: at Object.onInvoke (file: apps\oxseco\src\webpack:\d:\Project Workspace\gcr_oxseco\oxs-frontend-mobile\node_modules\@angular\core\fesm5\core.js:27859:0) JS: at ZoneDelegate.push.../../../node_modules/@nativescript/angular/zone-js/dist/zone-nativescript.js.ZoneDelegate.invoke (file: apps\oxseco\src\webpack:\d:\Project Workspace\gcr_oxseco\oxs-frontend-mobile\node_modules\@nativescript\angular\zone-js\dist\zone-nativescript.js:387:0) JS: at Zone.push.../../../node_modules/@nativescript/angular/zone-js/dist/zone-nativescript.js.Zone.run (file: apps\oxseco\src\webpack:\d:\Project Workspace\gcr_oxseco\oxs-frontend-mobile\node_modules\@nativescript\angular\zone-js\dist\zone-nativescript.js:138:0) JS: at file:///data/data/org.nativ...

Version: Angular : 9.1.0 Native-core: 6.5.10

Here is my package.json

{ "name": "sample", "version": "0.0.1", "license": "MIT", "scripts": { "android": "tns run android --env.aot", "ios": "tns run ios --env.aot", "mobile": "tns run", "preview": "tns preview", "ngcc": "ngcc --properties es2015 module main --first-only", "postinstall": "node ./decorate-angular-cli.js && ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points", "ng": "nx", "nx": "nx", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "nx workspace-lint && ng lint", "e2e": "ng e2e", "affected:apps": "nx affected:apps", "affected:libs": "nx affected:libs", "affected:build": "nx affected:build", "affected:e2e": "nx affected:e2e", "affected:test": "nx affected:test", "affected:lint": "nx affected:lint", "affected:dep-graph": "nx affected:dep-graph", "affected": "nx affected", "format": "nx format:write", "format:write": "nx format:write", "format:check": "nx format:check", "update": "ng update @nrwl/workspace", "workspace-schematic": "nx workspace-schematic", "dep-graph": "nx dep-graph", "help": "nx help" }, "private": true, "dependencies": { "@angular/animations": "9.1.0", "@angular/common": "9.1.0", "@angular/compiler": "9.1.0", "@angular/core": "9.1.0", "@angular/forms": "9.1.0", "@angular/platform-browser": "9.1.0", "@angular/platform-browser-dynamic": "9.1.0", "@angular/router": "9.1.0", "@nativescript/angular": "~9.0.0", "@nativescript/core": "~6.5.5", "@nativescript/schematics": "9.0.0", "@nativescript/theme": "~2.2.1", "@ngrx/effects": "9.2.0", "@ngrx/entity": "9.2.0", "@ngrx/router-store": "9.2.0", "@ngrx/store": "9.2.0", "@ngrx/store-devtools": "9.2.0", "@ngx-translate/core": "13.0.0", "@ngx-translate/http-loader": "6.0.0", "@nrwl/angular": "9.5.1", "@nstudio/nativescript-checkbox": "^1.0.0", "@nstudio/nativescript-floatingactionbutton": "2.1.0", "nativescript-accordion": "6.0.0-beta.2", "nativescript-angular": "9.0.0-next-2019-11-12-155500-01", "nativescript-carousel": "^6.1.1", "nativescript-datetimepicker": "^1.2.2", "nativescript-drop-down": "^5.0.6", "nativescript-linearprogressbar": "1.0.4", "nativescript-material-cardview": "3.2.19", "nativescript-ui-sidedrawer": "8.0.1", "reflect-metadata": "~0.1.12", "rxjs": "~6.5.4", "tns-core-modules": "6.5.0", "tslib": "1.10.0", "zone.js": "0.10.2" }, "devDependencies": { "@angular-devkit/build-angular": "0.901.0", "@angular/cli": "9.1.0", "@angular/compiler-cli": "9.1.0", "@angular/language-service": "9.1.0", "@nativescript/schematics": "~2.0.0", "@nativescript/tslint-rules": "~0.0.5", "@ngtools/webpack": "9.1.0", "@ngrx/schematics": "9.2.0", "@nrwl/cypress": "9.5.1", "@nrwl/jest": "9.5.1", "@nrwl/workspace": "9.5.1", "@types/jest": "25.1.4", "@types/node": "~8.9.4", "codelyzer": "~5.0.1", "cypress": "4.1.0", "dotenv": "6.2.0", "eslint": "6.8.0", "jest": "25.2.3", "jest-preset-angular": "8.1.2", "nativescript-dev-webpack": "~1.5.0", "prettier": "2.0.4", "ts-jest": "25.2.1", "ts-node": "~7.0.0", "tslint": "~6.0.0", "typescript": "~3.8.3" }, "nativescript": { "id": "org.nativescript.ngsample", "tns-android": { "version": "6.5.3" } } }

svmashok commented 4 years ago

hi @rigor789

Any update?