import { Component } from ‘@angular/core’;
import { NavController, NavParams,ViewController,ToastController,LoadingController } from ‘ionic-angular’;
import { CommonService } from “…/…/providers/common”;
import { GlobalVars } from “…/…/providers/global”;
import { Http } from “@angular/http”;
@Component({
selector: ‘page-responsetemplate’,
templateUrl: ‘responsetemplate.html’,
//providers: [CommonService, GlobalVars]
})
export class ResponsetemplatePage {
public template;
public language_common;
public loader;
public loadflag = false;
constructor(public navCtrl: NavController, public navParams: NavParams,public viewCtrl: ViewController,public ulrs: GlobalVars,private toastCtrl: ToastController,private loadingCtrl: LoadingController,public http: Http/,public cmn:CommonService/) {
this.language_common = JSON.parse(
window.localStorage.getItem(“lang_common”)
);
}
ionViewDidLoad() {
console.log(‘ionViewDidLoad ResponsetemplatePage’);
}
dismiss() {
this.viewCtrl.dismiss();
}
save(){
if(this.template == “” || this.template == undefined){
this.showToast(“Please enter review response you want to save.”);
return;
}
}
showToast(message: String) {
let toast = this.toastCtrl.create({
message: message.toString(),
duration: 3000
});
toast.present();
}
showLoader1(message: String) {
return new Promise((resolve, reject) => {
if (message != undefined) {
this.loader = this.loadingCtrl.create({
content: message.toString()
});
this.loader.present();
this.loadflag = true;
}
});
}
hideLoader() {
if (this.loadflag) {
this.loader.dismiss();
this.loadflag = false;
}
}
}
the functions after save are into my CommonService. I have to rewrite these code into my file as it showing me error into this.
@SanduCuragau Sorry I couldn’t share the context before as I have to take permission from my senior developer before it.
@vivek-23 my ionic serve is working fine, but when I run the URL into browser then it’s showing this error. Below is the ionic serve
ionic serve --address 192.168.20.21 --port 2222
[WARN] Detected @ionic/cli-plugin-cordova in your package.json.
As of CLI 3.8, it is no longer needed. You can uninstall it:
npm uninstall --save-dev --save-exact @ionic/cli-plugin-cordova
[WARN] Detected @ionic/cli-plugin-ionic-angular in your package.json.
As of CLI 3.8, it is no longer needed. You can uninstall it:
npm uninstall --save-dev --save-exact @ionic/cli-plugin-ionic-angular
[INFO] Starting app-scripts server: --address 192.168.20.21 --port 2222 --livereload-port 35729 - Ctrl+C to
cancel
[08:31:39] watch started …
[08:31:39] build dev started …
[08:31:39] Proxy added: service links
[08:31:39] Proxy added: service links
[08:31:39] Proxy added: service links
[08:31:39] clean started …
[08:31:39] clean finished in 35 ms
[08:31:39] copy started …
[08:31:39] deeplinks started …
[08:31:40] deeplinks finished in 478 ms
[08:31:40] transpile started …
[08:31:46] transpile finished in 6.08 s
[08:31:46] preprocess started …
[08:31:46] preprocess finished in less than 1 ms
[08:31:46] webpack started …
[08:31:46] copy finished in 7.14 s
[08:31:52] webpack finished in 5.74 s
[08:31:52] sass started …
[08:31:53] sass finished in 1.08 s
[08:31:53] postprocess started …
[08:31:53] postprocess finished in 13 ms
[08:31:53] lint started …
[08:31:53] build dev finished in 13.81 s
[08:31:53] watch ready in 14.24 s
[08:31:53] dev server running: http://192.168.20.21:2222/
[INFO] Development server running
Local: http://localhost:2222
External: http://192.168.20.21:2222
Error when url is run into browser.