Error: “Unresolved function or method present()” when using LoadingController - ionic-framework

ISSUE:
When I use the LoadingController in my project, I see the following error: "Unresolved function or method present()"
Here is the screenshot code that I have in my file:
As we can see from the screenshot, there are 2 pieces of code that show the same error. The code from lines: 51-61 are a direct copy of the code from the ionic documentation that can be seen under Usage
The code from lines: 63-69 are the trimmed down and basic version of the code and for testing purposes await is removed in front of the loading.present();. Yet it throws the same error as the original code above.
GOAL:
What can we do to fix the issue so that Intellij Idea (IDE) stops complaining about the same?
Following is the info from my package.json:
{
"name": "gf",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "https://ionicframework.com/",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/common": "~8.1.2",
"#angular/compiler": "~8.1.2",
"#angular/core": "~8.1.2",
"#angular/forms": "~8.1.2",
"#angular/platform-browser": "~8.1.2",
"#angular/platform-browser-dynamic": "~8.1.2",
"#angular/router": "~8.1.2",
"#ionic-native/core": "^5.0.0",
"#ionic-native/splash-screen": "^5.0.0",
"#ionic-native/status-bar": "^5.0.0",
"#ionic/angular": "^4.7.1",
"#ionic/storage": "^2.2.0",
"cordova-sqlite-storage": "^3.2.1",
"core-js": "^2.5.4",
"rxjs": "~6.5.1",
"tslib": "^1.9.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"#angular-devkit/architect": "~0.801.2",
"#angular-devkit/build-angular": "~0.801.2",
"#angular-devkit/core": "~8.1.2",
"#angular-devkit/schematics": "~8.1.2",
"#angular/cli": "~8.1.2",
"#angular/compiler": "~8.1.2",
"#angular/compiler-cli": "~8.1.2",
"#angular/language-service": "~8.1.2",
"#ionic/angular-toolkit": "~2.0.0",
"#types/jasmine": "~3.3.8",
"#types/jasminewd2": "~2.0.3",
"#types/node": "~8.9.4",
"codelyzer": "^5.0.0",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.4.3"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-sqlite-storage": {}
}
}
}

No sure it is the right way to do it but i managed to Intellij to stop whining
return (<any>loading).present();

Related

ionic cordova run browser errors

I am trying to run a live reload in the browser as i need to be able to see the camera working but i'm just running into one issue after another.
Command: ionic cordova run browser --livereload
The current error is this:
[ng] An unhandled exception occurred: Job name "..getProjectMetadata"
does not exist.
These errors don't even state where it's coming from, but here is my package... it seems to be related to the build-angular package but no matter what i do it either has the error above or the following depending on what version is used:
Schema validation failed with the following errors: Data path ""
should NOT have additional properties(project)
{
"name": "org.apache.cordova.newapp",
"displayName": "frontend",
"version": "1.0.0",
"description": "A sample Apache Cordova application that responds to the deviceready event.",
"main": "index.js",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"build-prod": "node --max_old_space_size=5048 ./node_modules/#angular/cli/bin/ng build --prod"
},
"private": true,
"dependencies": {
"#angular/animations": "^10.2.5",
"#angular/cdk": "^8.2.3",
"#angular/common": "^8.2.10",
"#angular/compiler": "^8.2.10",
"#angular/core": "^8.2.10",
"#angular/flex-layout": "^8.0.0-beta.27",
"#angular/forms": "^8.2.14",
"#angular/http": "^7.2.16",
"#angular/material": "^8.2.3",
"#angular/platform-browser": "^8.2.10",
"#angular/platform-browser-dynamic": "^8.2.10",
"#angular/router": "^8.2.10",
"#awesome-cordova-plugins/media-capture": "^5.37.3",
"#ionic/angular-toolkit": "^5.0.3",
"#ionic/core": "^5.8.4",
"#ng-bootstrap/ng-bootstrap": "^5.3.1",
"angular-calendar": "^0.28.28",
"angular-flatpickr": "^3.6.6",
"angular-linky": "^1.2.2",
"angular-password-strength-meter": "^3.0.1",
"angularx-flatpickr": "^6.6.0",
"angularx-social-login": "^3.5.7",
"date-fns": "^2.25.0",
"emoji-js": "^3.6.0",
"flatpickr": "^4.6.9",
"hammerjs": "^2.0.8",
"jquery": "^3.6.0",
"ng-recaptcha": "^7.0.2",
"ng-socket-io": "^0.2.4",
"ng2-file-upload": "^1.4.0",
"ngb-modal": "^2.0.3",
"ngx-emoji-picker": "0.0.2",
"ngx-file-drop": "^10.1.1",
"ngx-image-cropper": "^3.3.5",
"ngx-infinite-scroll": "^9.1.0",
"ngx-lightbox": "^2.5.1",
"ngx-paypal": "^6.2.0",
"ngx-toastr": "^11.3.3",
"ngx-ui-loader": "^8.0.0",
"rxjs": "^6.6.7",
"rxjs-compat": "^6.6.7",
"socket.io-client": "^2.4.0",
"tslib": "^1.14.1",
"ws": "^7.5.5",
"zone.js": "~0.9.1",
"zxcvbn3": "^0.1.1"
},
"devDependencies": {
"#angular-devkit/build-angular": "^13.1.2",
"#angular/cli": "^8.3.29",
"#angular/compiler-cli": "^8.2.10",
"#angular/language-service": "^8.2.10",
"#types/jasmine": "~3.3.8",
"#types/jasminewd2": "^2.0.10",
"#types/node": "~8.9.4",
"codelyzer": "^5.0.0",
"cordova-android": "^9.1.0",
"cordova-browser": "^6.0.0",
"cordova-plugin-device": "2.0.2",
"cordova-plugin-ionic-keyboard": "^2.0.5",
"cordova-plugin-ionic-webview": "^4.0.0",
"cordova-plugin-splashscreen": "5.0.2",
"cordova-plugin-statusbar": "2.4.2",
"cordova-plugin-whitelist": "^1.3.4",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.7.0",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.5.3"
},
"keywords": [
"ecosystem:cordova"
],
"author": "Apache Cordova Team",
"license": "Apache-2.0",
"cordova": {
"plugins": {
"cordova-plugin-whitelist": {},
"cordova-plugin-media-capture": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-ionic-keyboard": {}
},
"platforms": [
"android",
"browser"
]
}
}

ERROR in The target entry-point "ngx-restangular" has missing dependencies: core-js/features/object

When i start 'ionic serve' i have this issue
[ng] ERROR in The target entry-point "ngx-restangular" has missing dependencies:
[ng] - core-js/features/object
And the app don't show in browser.
My Package.json
"dependencies": {
"#angular/common": "~9.0.7",
"#angular/core": "~9.0.7",
"#angular/forms": "~9.0.7",
"#angular/platform-browser": "~9.0.7",
"#angular/platform-browser-dynamic": "~9.0.7",
"#angular/router": "~9.0.7",
"#ionic-native/core": "^5.0.7",
"#ionic-native/geolocation": "^5.27.0",
"#ionic-native/in-app-browser": "^5.35.0",
"#ionic-native/native-geocoder": "^5.27.0",
"#ionic-native/splash-screen": "^5.0.0",
"#ionic-native/status-bar": "^5.0.0",
"#ionic/angular": "^5.0.0",
"cordova-android": "~7.0.0",
"cordova-ios": "^5.1.1",
"cordova-plugin-add-swift-support": "^2.0.2",
"cordova-plugin-geolocation": "^4.1.0",
"cordova-plugin-nativegeocoder": "^3.4.1",
"ngx-permissions": "^8.1.1",
"ngx-restangular": "^5.0.0",
"rxjs": "~6.5.4",
"tslib": "^1.10.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"#angular-devkit/build-angular": "~0.901.5",
"#angular/cli": "9.1.15",
"#angular/compiler": "~9.0.7",
"#angular/compiler-cli": "~9.0.7",
"#angular/language-service": "~9.0.7",
"#ionic/angular-toolkit": "^2.1.1",
"#types/jasmine": "~3.5.0",
"#types/jasminewd2": "~2.0.3",
"#types/node": "^12.11.1",
"codelyzer": "^5.1.2",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-ionic-webview": "^4.2.1",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.0",
"karma-jasmine": "~3.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"moment": "^2.29.1",
"protractor": "~5.4.3",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~3.7.3"
},
Help please
I ran
npm i core-js --legacy-peer-deps
and my problem was solved

How to get base64 file size while choosing image from mobile device in ionic with #ionic-native/camera

// in Component
pickImage(sourceType) {
const options: CameraOptions = {
quality: 100,
sourceType: sourceType,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
correctOrientation:true
}
this.camera.getPicture(options).then((imageData) => {
console.log("imageData", imageData);
this.base64Image = 'data:image/jpeg;base64,' + imageData;
// I want to get file size here
// because i want to validate image of size 2MB or less
}, async (err) => {
console.log("err", err);
const toast = await this.toastController.create({
message: 'Error Occurs',
duration: 3000,
position: 'bottom',
color: "danger",
animated: true,
});
toast.present();
});
}
my package.json
{
"name": "ionic-conference-app",
"version": "0.0.0",
"description": "Ionic Conference App",
"author": "Ionic Team <hi#ionicframework.com>",
"license": "Apache-2.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"postinstall": "webdriver-manager update --standalone false --gecko false"
},
"repository": {
"type": "git",
"url": "https://github.com/ionic-team/ionic-conference-app.git"
},
"private": true,
"dependencies": {
"#angular/animations": "^8.2.14",
"#angular/cdk": "~8.2.3",
"#angular/common": "^8.2.14",
"#angular/core": "^8.2.14",
"#angular/forms": "^8.2.14",
"#angular/material": "^8.2.3",
"#angular/platform-browser": "^8.2.14",
"#angular/platform-browser-dynamic": "^8.2.14",
"#angular/pwa": "^0.803.23",
"#angular/router": "^8.2.14",
"#angular/service-worker": "^8.2.14",
"#capacitor/android": "^1.5.1",
"#capacitor/core": "1.5.1",
"#ionic-native/camera": "^5.24.0",
"#ionic-native/core": "5.0.0-beta.15",
"#ionic-native/file": "^5.24.0",
"#ionic-native/google-plus": "^5.23.0",
"#ionic-native/in-app-browser": "5.0.0-beta.15",
"#ionic-native/native-storage": "^5.23.0",
"#ionic-native/social-sharing": "^5.24.0",
"#ionic-native/splash-screen": "5.0.0-beta.15",
"#ionic-native/status-bar": "5.0.0-beta.15",
"#ionic/angular": "^5.0.4",
"#ionic/storage": "^2.1.3",
"angularfire2": "^5.4.2",
"chart.js": "^2.9.3",
"cordova-android": "^7.0.0",
"cordova-browser": "^6.0.0",
"cordova-ios": "^5.1.1",
"cordova-plugin-camera": "^4.1.0",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-file": "^6.0.2",
"cordova-plugin-inappbrowser": "^3.2.0",
"cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-ionic-webview": "^4.1.3",
"cordova-plugin-splashscreen": "^5.0.3",
"cordova-plugin-statusbar": "^2.4.3",
"cordova-plugin-whitelist": "^1.3.4",
"cordova-plugin-x-socialsharing": "^5.6.5",
"core-js": "^3.6.4",
"es6-promise-plugin": "^4.2.2",
"firebase": "^7.13.2",
"hammerjs": "^2.0.8",
"ng-payment-card": "0.0.8",
"rxjs": "^6.5.4",
"sw-toolbox": "3.6.0",
"tslib": "^1.10.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"#angular-devkit/architect": "^0.803.23",
"#angular-devkit/build-angular": "^0.803.23",
"#angular-devkit/core": "^8.3.23",
"#angular-devkit/schematics": "^8.3.23",
"#angular/cli": "^8.3.23",
"#angular/compiler": "^8.2.14",
"#angular/compiler-cli": "^8.2.14",
"#angular/language-service": "^8.2.14",
"#capacitor/cli": "1.5.1",
"#ionic/angular-toolkit": "^2.1.2",
"#ionic/lab": "^2.0.19",
"#types/jasmine": "3.4.6",
"#types/jasminewd2": "2.0.8",
"#types/node": "^12.12.26",
"codelyzer": "^5.2.1",
"jasmine-core": "^3.5.0",
"jasmine-spec-reporter": "4.2.1",
"karma": "4.4.1",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage-istanbul-reporter": "2.1.1",
"karma-jasmine": "2.0.1",
"karma-jasmine-html-reporter": "1.4.2",
"protractor": "^5.4.3",
"puppeteer": "^1.20.0",
"ts-node": "8.5.0",
"tslint": "^5.20.1",
"typescript": "~3.5.3"
},
"cordova": {
"platforms": [
"ios",
"browser",
"android"
],
"plugins": {
"cordova-plugin-device": {},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-whitelist": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-x-socialsharing": {
"ANDROID_SUPPORT_V4_VERSION": "24.1.1+",
"PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION": "This app requires photo library access to function properly.",
"PHOTO_LIBRARY_USAGE_DESCRIPTION": "This app requires photo library access to function properly."
},
"cordova-plugin-camera": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
"cordova-plugin-file": {}
}
}
}
Your application seems to be built on capacitor, so you can use the capacitor inbuilt camera plugin.
https://capacitor.ionicframework.com/docs/apis/camera/
You can specify under CameraOptions - resultType:CameraResultType.Base64, how data is returned.

Cannot find module '#ionic-native/power-management/ngx'

I installed cordova power management plugin into my ionic application. Following the usage guidance "https://ionicframework.com/docs/native/power-management#installationenter link description here", I import the class as below:
import { PowerManagement } from '#ionic-native/power-management/ngx';
but, when build this ionic app, got the error:
Cannot find module '#ionic-native/power-management/ngx'
Why this error appears? How to fix it?
I try to import the class with removing the ngx module, then error disappears:
import { PowerManagement } from '#ionic-native/power-management';
my package.json file is:
{
"name": "ionicapp",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"start": "ionic-app-scripts serve",
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint"
},
"dependencies": {
"#angular/animations": "5.2.11",
"#angular/common": "5.2.11",
"#angular/compiler": "5.2.11",
"#angular/compiler-cli": "5.2.11",
"#angular/core": "^5.2.11",
"#angular/forms": "5.2.11",
"#angular/http": "5.2.11",
"#angular/platform-browser": "5.2.11",
"#angular/platform-browser-dynamic": "5.2.11",
"#angular/router": "^6.1.9",
"#ionic-native/background-geolocation": "^4.16.0",
"#ionic-native/background-mode": "^4.20.0",
"#ionic-native/ble": "^4.12.0",
"#ionic-native/bluetooth-serial": "^4.12.2",
"#ionic-native/camera": "4.3.3",
"#ionic-native/core": "^4.12.2",
"#ionic-native/geolocation": "^4.12.0",
"#ionic-native/google-maps": "^4.12.0",
"#ionic-native/launch-navigator": "^4.15.0",
"#ionic-native/native-storage": "^4.12.0",
"#ionic-native/network": "^4.12.2",
"#ionic-native/network-interface": "^4.12.2",
"#ionic-native/power-management": "^4.20.0",
"#ionic-native/splash-screen": "~4.11.0",
"#ionic-native/sqlite": "^4.12.2",
"#ionic-native/status-bar": "^4.11.0",
"#ionic/storage": "^2.1.3",
"#ngx-translate/core": "8.0.0",
"#ngx-translate/http-loader": "^2.0.0",
"#types/google-maps": "^3.2.0",
"#types/googlemaps": "^3.30.12",
"an": "0.0.8",
"angularfire2": "^5.0.2",
"chart.js": "^2.7.2",
"cordova-android": "7.1.0",
"cordova-plugin-actionsheet": "^2.3.3",
"cordova-plugin-background-mode": "git+https://github.com/tushe/cordova-plugin-background-mode.git",
"cordova-plugin-ble-central": "^1.2.2",
"cordova-plugin-bluetooth-serial": "^0.4.7",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-dialogs": "^2.0.1",
"cordova-plugin-geolocation": "^4.0.1",
"cordova-plugin-googlemaps": "^2.4.2",
"cordova-plugin-ionic-keyboard": "^2.1.2",
"cordova-plugin-ionic-webview": "^2.1.0",
"cordova-plugin-mauron85-background-geolocation": "^3.0.0-alpha.43",
"cordova-plugin-nativestorage": "^2.3.2",
"cordova-plugin-network-information": "^2.0.1",
"cordova-plugin-networkinterface": "^2.0.0",
"cordova-plugin-powermanagement-orig": "^1.1.2",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-sqlite-storage": "^2.4.0",
"firebase": "^5.5.3",
"ionic-angular": "3.9.2",
"ionic-native": "4.1.1",
"ionicons": "3.0.0",
"ng2-charts": "^1.6.0",
"rxjs": "5.5.11",
"sw-toolbox": "3.6.0",
"uk.co.workingedge.phonegap.plugin.launchnavigator": "^4.2.2",
"zone.js": "0.8.26",
"at.gofg.sportscomputer.powermanagement": "~1.1.2"
},
"devDependencies": {
"#ionic/app-scripts": "^3.2.0",
"#mauron85/cordova-plugin-background-geolocation": "^3.0.0-alpha.4",
"typescript": "~2.6.2"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-ble-central": {},
"cordova-plugin-whitelist": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-geolocation": {
"GEOLOCATION_USAGE_DESCRIPTION": "To locate you"
},
"cordova-plugin-mauron85-background-geolocation": {
"GOOGLE_PLAY_SERVICES_VERSION": "11+",
"ANDROID_SUPPORT_LIBRARY_VERSION": "23+",
"ALWAYS_USAGE_DESCRIPTION": "App requires background tracking enabled",
"MOTION_USAGE_DESCRIPTION": "App requires motion detection"
},
"cordova-plugin-nativestorage": {},
"cordova-sqlite-storage": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-bluetooth-serial": {},
"cordova-plugin-network-information": {},
"cordova-plugin-networkinterface": {},
"uk.co.workingedge.phonegap.plugin.launchnavigator": {
"OKHTTP_VERSION": "3.+"
},
"cordova-plugin-background-mode": {},
"at.gofg.sportscomputer.powermanagement": {}
},
"platforms": [
"android"
]
}
}
Use ngx if your Angular version is >=6
You seem to be using the wrong plugin version. Correct your error by following the steps mentioned below
Check your project type in ionic.config.json file.
If the type is "ionic-angular", then install 4 version.
ionic cordova plugin add cordova-plugin-powermanagement-orig
npm install #ionic-native/power-management#4
If the type is "angular", then install the latest version
ionic cordova plugin add cordova-plugin-powermanagement-orig
npm install #ionic-native/power-management
Note:
Add ngx at the end of import only if you are using Angular 6 or 6+
import { PowerManagement } from '#ionic-native/power-management/ngx';
if not remove ngx from the import both in app.module.ts and app.component.ts
import { PowerManagement } from '#ionic-native/power-management';
Refencence:https://github.com/ionic-team/ionic/issues/15225#issuecomment-414074074

Type 'promise.Promise<string>' is not assignable to type 'Promise<string>'

I am facing some strange issue with the protractor tests. I have used the following piece of code to get the text of the element.
getTitleElementValue(): Promise<string> {
return this.getTitleElement().getAttribute('value')
}
all went good till I pushed my code to git. Immediately I pulled the latest code and from then I am getting the error
Type 'promise.Promise<string>' is not assignable to type 'Promise<string>'
I am confused with the output and need some some inputs from you regarding the issue. would like to provide any other details. below is the package.json
{
"name": "ris-beta",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"generate:proxy": "node config/proxy.js",
"start": "npm run generate:proxy && ng serve --ssl true --ssl-key config/ssl/localhost.key --ssl-cert config/ssl/localhost.crt --proxy-config proxy.conf.json --host=0.0.0.0",
"start:http": "npm run generate:proxy && ng serve --proxy-config proxy.conf.json --host=0.0.0.0",
"test": "ng test --watch=false",
"pree2e": "webdriver-manager update --standalone false --gecko false",
"e2e": "protractor",
"lint": "ng lint --type-check",
"deploy": "npm run test && npm run clean-build && npm run deploy-only",
"rimraf": "rimraf",
"clean:dist": "npm run rimraf -- dist",
"clean-build": "npm run clean:dist && ng build -prod --aot=false --sourcemaps",
"deploy-only": "node config/deploy.js",
"compodoc": "./node_modules/.bin/compodoc -p src/tsconfig.app.json"
},
"private": true,
"dependencies": {
"#angular/animations": "^5.0.0-rc.6",
"#angular/cdk": "^5.2.3",
"#angular/common": "^5.2.7",
"#angular/compiler": "^5.2.7",
"#angular/core": "^5.2.7",
"#angular/forms": "^5.2.7",
"#angular/http": "^5.2.7",
"#angular/material": "^5.2.3",
"#angular/platform-browser": "^5.2.7",
"#angular/platform-browser-dynamic": "^5.2.7",
"#angular/router": "^5.2.7",
"#ngrx/effects": "^4.1.0",
"#ngrx/store": "^4.1.0",
"#ngrx/store-devtools": "^4.0.0",
"angular-split": "^0.2.7",
"angular-tree-component": "^5.2.0",
"bootstrap": "4.0.0-alpha.6",
"core-js": "^2.4.1",
"font-awesome": "^4.7.0",
"ngx-clipboard": "^9.0.0",
"normalize.css": "^7.0.0",
"primeng": "^5.0.0",
"rxjs": "=5.5.2",
"tinymce": "4.7.4",
"zone.js": "^0.8.14"
},
"devDependencies": {
"#angular/cli": "1.5.0-rc.3",
"#angular/compiler-cli": "^5.2.7",
"#angular/language-service": "^5.2.7",
"#compodoc/compodoc": "^1.0.8",
"#types/jasmine": "~2.5.53",
"#types/jasminewd2": "~2.0.2",
"#types/node": "^6.0.101",
"archiver": "2.0.0",
"codelyzer": "~3.2.0",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-phantomjs-launcher": "^1.0.4",
"karma-remap-istanbul": "^0.6.0",
"ngx-clipboard": "^9.0.0",
"normalize.css": "^7.0.0",
"phantomjs-polyfill": "0.0.2",
"protractor": "~5.1.2",
"quill": "^1.3.4",
"sync-request": "4.0.3",
"ts-node": "~3.2.0",
"tslint": "~5.7.0",
"typescript": "~2.4.2"
}
}
Thanks in advance.
Because Protractor has self Promise implement and currently Protractor still use self Promise implement, not use Nodejs native Promise.
You declared the result value using Nodejs native Promise, should use the Protractor self Promise implement.
import { browser, by, protractor, promise, ElementFinder } from 'protractor'
getTitleElementValue(): promise.Promise<string> {
return this.getTitleElement().getAttribute('value')
}
FYI, Protractor switch to use Nodejs native Promise is going on and plan to happen at 2018/10.