javascript - Can't resolve all parameters for MapsPage:(?,NavController,LaunchNavigator,.......) in Angular 2 -
so using angular2 ionic2 mobile application. application compiling , running until added new module application have navigation in google maps. using phonegap-launch-navigator so. class importing modules maps class , structure of class looks this;
import { launchnavigator, launchnavigatoroptions} 'ionic-native'; import { component, ngzone } "@angular/core"; import { navcontroller, platform, navparams } 'ionic-angular'; import {googlemap, googlemapsevent, googlemapslatlng, googlemapsmarkeroptions, cameraposition } 'ionic-native'; import { observable } 'rxjs/observable'; import 'rxjs/add/operator/map'; import { geolocation } 'ionic-native'; import { injectable,forwardref,inject } "@angular/core"; @component({ selector: 'maps-page', templateurl: 'maps.html', }) export class mapspage { private map: googlemap; destination:string; start:string; constructor(public launchnavigatoroptions: launchnavigatoroptions, private _navcontroller: navcontroller, private launchnavigator:launchnavigator, private platform: platform, public navctrl: navcontroller, public navparams: navparams, private _zone: ngzone) { this.start = ""; this.destination = "westminster, london, uk"; this.platform.ready().then(() => this.onplatformready()); }
and package.json looks this
{ "name": "ionic-hello-world", "author": "ionic framework", "homepage": "http://ionicframework.com/", "private": true, "scripts": { "clean": "ionic-app-scripts clean", "build": "ionic-app-scripts build", "ionic:build": "ionic-app-scripts build", "ionic:serve": "ionic-app-scripts serve", "test": "mocha" }, "dependencies": { "@angular/common": "2.2.1", "@angular/compiler": "2.2.1", "@angular/compiler-cli": "2.2.1", "@angular/core": "2.2.1", "@angular/forms": "2.2.1", "@angular/http": "2.2.1", "@angular/platform-browser": "2.2.1", "@angular/platform-browser-dynamic": "2.2.1", "@angular/platform-server": "2.2.1", "@ionic/cloud-angular": "^0.11.0", "@ionic/storage": "1.1.7", "angular2-jwt": "^0.1.28", "bootstrap": "^3.3.7", "ionic-angular": "2.0.0-rc.4", "ionic-native": "2.2.11", "ionicons": "3.0.0", "jquery": "^3.1.1", "moment": "^2.17.1", "ng2-translate": "^5.0.0", "rxjs": "5.0.0-beta.12", "zone.js": "0.6.26" }, "devdependencies": { "@ionic/app-scripts": "^1.0.0", "typescript": "2.0.9" }, "cordovaplugins": [ "cordova-plugin-whitelist", "cordova-plugin-console", "cordova-plugin-statusbar", "cordova-plugin-device", "cordova-plugin-splashscreen", "ionic-plugin-keyboard" ], "cordovaplatforms": [ "ios", { "platform": "ios", "version": "", "locator": "ios" } ], "description": "myapp: ionic project" }
after importing these 2 modules , putting them in constructor, not able start application , gives runtime error saying "can't resolve parameters mapspage(?,navcontroller,launchnavigator,platform,navcontroller,navparams,ngzone). think problem launchnavigatoroptions because when comment 1 out, application able run again without problems. there can make work? appreciated. thanks!
looks using ionic-native v2.2.11.
in version plugins global , static , not supposed injected in constructor. remove
public launchnavigatoroptions: launchnavigatoroptions
and
private launchnavigator:launchnavigator,
from constructor.
check docs upgrading ionic-native 3.x
Comments
Post a Comment