ionic-framework

Ionic conditional class css

末鹿安然 提交于 2019-12-22 03:21:47
问题 I am using Ionic3, and have: <span class="char-left">{{REVIEW_MAX_LENGTH-ratingModel.review.length}} characters left</span> I would like to conditionally change the class value when another value is populated, i.e when ratingForm.controls.review.length > 0 change the values to class="char-left-error" . I did look at ng-class, but cannot seem to get it to work. Any help appreciated. 回答1: If it's just a single class, you can try with <span class="char-left" [class.char-left-error]="ratingForm

AngularJS - 3-button group acting as radio buttons

落花浮王杯 提交于 2019-12-22 03:20:57
问题 Using the Ionic framework, I'm trying to create a group of three buttons that act as radio buttons: If I click on Breakfast, I would like Lunch and Dinner to return to their normal (white) state, and Breakfast to turn Blue. With my current code, I can't get this functionality to work, although I can get the buttons to switch color, slightly randomly (perhaps I just don't understand the ng-class directive). Here is my HTML code: <div class="bar bar-subheader"> <div class="button-bar"> <a class

Integrating Mailgun with Ionic

独自空忆成欢 提交于 2019-12-22 01:29:59
问题 I want to send email without using email composer, so I followed tutorial from https://www.thepolyglotdeveloper.com/2016/05/send-emails-ionic-2-mobile-app-via-rackspace-mailgun-api/ to use Mailgun API. Since Http from "@angular/http" has been deprecated, the code from tutorial is not working anymore. Here is what I have so far: I replaced import {Http, Request, RequestMethod} from "@angular/http"; with import {HttpClient, HttpHeaders} from '@angular/common/http'; and send method is send() {

Uploading file over https with cordova filetransfer

会有一股神秘感。 提交于 2019-12-22 01:05:39
问题 I've got a problem with the file transfer plugin that i can't seem to figure out. My code works when i'm using http, but when I try to upload over https it seems that it doesn't send the parameters to my api but it does reach my api. only the the file is missing, the x-session-token header is present and valid. This is the code i use for uploading the file: $scope.options = {}; $scope.options.fileKey = "file"; $scope.options.fileName = $scope.img.substr($scope.img.lastIndexOf('/') + 1);

Ionic 4: How to focus the view of ion-segment when its clicked

牧云@^-^@ 提交于 2019-12-22 00:52:34
问题 There are five ion-segment-button, Something | Something | Something | Something | Something If I click the 4th segment the view didnt follow or focus to the current segment. Above is the current screenshot I want the view move (to the right or focus it to the center) when the segment is clicked HTML: <ion-row> <!-- ion-segment --> <ion-toolbar> <ion-segment (ionChange)="segmentChanged()" [(ngModel)]="segment" color="tertiary" scrollable> <ion-segment-button value="0"> Something </ion-segment

hide-nav-bar hides nav-buttons too. I want to retain the view title and the ion-nav-buttons

此生再无相见时 提交于 2019-12-22 00:39:37
问题 I added hide-nav-bar attribute expecting to hide the navigation bar on profile page. It removes the entire navigation bar along with buttons and title. Profile.html <ion-view view-title="Profile" hide-nav-bar="true"> <ion-content> </ion-content> <ion-footer-bar align-title="left" class="bar-balanced"> <a class="button-icon title" href=""> <i class="icon ion-ios-telephone-outline"></i> </a> </ion-footer-bar> </ion-view> Side-menu code snippet : <ion-side-menu-content> <ion-nav-bar class="bar

Ionic tabs and side menu navigation issue

♀尐吖头ヾ 提交于 2019-12-22 00:28:20
问题 I learn and try to create an ionic app with tabs combining the side menu. Here is what it looks like (Codepen): The side-menu part is okay. There is an additional link on my home page. Here is my problem: After clicking the link, I can go back to the previous page only through the back button. And my home tab doesn't work. I try to add another link to my about page, and either back button or home tab could go back to the previous page, which is the home page. Here is my .js file: angular

angular 4: load components one by one

我只是一个虾纸丫 提交于 2019-12-22 00:16:19
问题 I'm using Ionic 3 with based on angular 4 framework. And I need to know if I have multiple children components can I load them asynchronously, one by one: Load parent; Load first child; When first child loaded, load second child; When second child loaded, load third child and so on For example I have a parent component app.module.ts with children: @NgModule({ declarations: [ AppComponentPage ], imports: [ IonicPageModule.forChild(AppComponentPage), ChildOneComponentModule,

Download file in ios for ionic 3 not showing in files folder

≯℡__Kan透↙ 提交于 2019-12-22 00:12:37
问题 ionic 3 I am using #cordova-plugin-file-transfer, to download the file from url in android and ios. For Android it is working fine. But for ios app, i am facing a problem. The file is downloading successfully, but i am not able to see downloaded file on ios device. Here is my code for ios => const transfer = this.transfer.create(); transfer.download(url, cordova.file.documentsDirectory + fileName).then( entry => { console.log(entry); this.apiService.showError("Download Succeeded."); this

How to resize image in Ionic 3 without quality reduce and target width and height?

旧巷老猫 提交于 2019-12-22 00:00:35
问题 I want to reduce the size of images taken by camera API but quality reduce is not good. The best thing is to reduce resolution but I don't want to use target width and height for all images. For example, I want image width be 1280 and image height change automatically by its ratio, but in API I should use exact width and height. How can I change height dynamic by image ratio??? For now, I use this code: this.camera.getPicture({ quality: 60, destinationType: this.camera.DestinationType.FILE