ionic3

Change colour navbar header Ionic 2

六月ゝ 毕业季﹏ 提交于 2019-12-19 06:45:27
问题 I have this problem... My colour is white right now, my code is like this: <ion-header > <ion-navbar> <ion-title> HELLO </ion-title> </ion-navbar> </ion-header> Change color with this opcion is easy (primary, secondary, danger, light, dark) <ion-header > <ion-navbar danger> <ion-title> HELLO </ion-title> </ion-navbar> </ion-header> but my problem is when I want to use custom colors. Somebody know how can I resolve it? Thanks inadvance. Best regards. 回答1: There're two ways of doing this, based

Typescript error: @viewChild undefined

孤人 提交于 2019-12-19 06:03:07
问题 Tried using the select() method in tabs.ts from the Ionic Tabs documentation. But it seems that when I tried running it, it says that "select is undefined" and I found out that my viewChild is actually empty/undefined when I tried console.log(tabs). Tried searching for the reason why viewChild is undefined but could not really understand why. Link to ionic tabs documentation: https://ionicframework.com/docs/api/components/tabs/Tabs/ tabs.html <ion-tabs #tabs> <ion-tab [root]="tab1Root"

How to use cordova-plugin-android-permissions in Ionic 3?

半腔热情 提交于 2019-12-19 03:56:59
问题 I am using a couple of cordova plugins like camera and Image Pickers in my App and they work great on all the Devices… but the problem comes for getting the Permission to these plugins from the phone. Below Android 6 Versions asks for these permissions while installing but Android 6 and above ask for these permissions only when for the first time when the user uses that plugin inside the application(i.e during the Runtime). I found this Ionic native plugin to handle these permissions in all

ngx-translate with dynamic text on ts file

半城伤御伤魂 提交于 2019-12-19 02:51:09
问题 I'm using ngx-translate for internationalization on Ionic 3 app. I have used pipe nicely on HTML code. But now I have a situation like below on ts file. Can you tell me how to handle such dynamic use case with ngx ? updateApi(topic) { this.showToast(`Topic ${topic.name} subscribed!`);//this is the dynamic text } showToast(message) { let toast = this.toastCtrl.create({ message: message, duration: 3000 }); toast.present(); } The problem here is I don't know the value of ${topic.name} up front.

Ionic3 Build-Error: Could not find play-services-auth-base.aar (15.0.1)

笑着哭i 提交于 2019-12-19 02:49:06
问题 i have a bigger Ionic3 project running and did not do any changes since i had a successful build last time. Today, i tried to build again, getting the error: Could not find play-services-auth-base.aar (com.google.android.gms:play-services-auth-base:15.0.1). I can not figure out why this happens. Cordova-platform is Version 6.3.0. Steps done so far: Installed cordova-android-play-services-gradle-release , which 15.+ as version during the build Installed cordova-android-support-gradle-release ,

Lazy load pages random error:ERROR Error: Uncaught (in promise): invalid link:

笑着哭i 提交于 2019-12-18 14:13:12
问题 I run into the following error every now and then. ERROR Error: Uncaught (in promise): invalid link:MenuPage at d (polyfills.js:3) at l (polyfills.js:3) at Object.reject (polyfills.js:3) at NavControllerBase._fireError (nav-controller-base.js:322) at NavControllerBase._failed (nav-controller-base.js:310) at nav-controller-base.js:365 at t.invoke (polyfills.js:3) at Object.onInvoke (core.es5.js:4125) at t.invoke (polyfills.js:3) at n.run (polyfills.js:3) at polyfills.js:3 at t.invokeTask

What is the purpose of the ionViewDidLoad() function?

五迷三道 提交于 2019-12-18 14:06:23
问题 On running ionic g page pageName I get generated .ts,.css and .html files. Inside the .ts file I have a function called ionViewDidLoad(){} and this is getting printed before my view appears. This can be done in constructor itself I believe? Can someone give me some reference of any blog or explanation about this function? 回答1: You're right, a lot of things could be done both in the constructor or in the ionViewDidLoad and the result will be the same... But the main difference between the

Alert controller input box validation

我是研究僧i 提交于 2019-12-18 13:16:46
问题 How to validate and show error for Input in Alert Controller in Ionic 2 or 3 let prompt = Alert.create({ title: 'Alert input validation', message: "How can I validate below input field?", inputs: [ { name: 'email', placeholder: 'email' }, ], buttons: [ { text: 'Save', handler: data => { let validateObj = this.validateEmail(data); if (!validateObj.isValid) { alert(validateObj.message); return false; } else { //make HTTP call } } } ] }); Some one already updated alertcontroller and did pull

Create a javascript starter app with ionic 2 rather than a typescript app

我与影子孤独终老i 提交于 2019-12-18 07:38:20
问题 I am trying to create a JS starter project but ionic start xxx --v2 creates a typescript project. I need to create a JS starter project so I can copy across an existing JS ionic 2 app to a clean installation. I did try renaming all of my JS files to typescript but a get a shed load of error messages of the type: Property xxx does not exist on type yyy 回答1: Just like you can read in Ionic docs: Ionic 2 applications are created as TypeScript by default. Want to use JavaScript instead? Pass the

Ionic 3 Response with status: 0 for URL: null

大城市里の小女人 提交于 2019-12-18 07:14:33
问题 I have an Ionic 3 app. I recently added the iOS platform. When i run it on iOS (emulator and device) all the server requests that has headers fail with the error "Response with status: 0 for URL: null" . On Android those requests works fine. If I do the requests without headers i get the expected response from server. I know the problem is with WKWebView and CORS . The server has the CORS configured correctly. I do the requests with @angular/http module. Let's see some code. This is my