Search Posts

Category: ionic-framework

How to Rotate an image over another with fixed position ionic1

I have to rotate an image on touch on a fixed axis. Currently I am able to set the image to a fixed position with certain angle. But when i am trying to rotate it with some other deg. then the position of image gets changed. I have set the transform-origin: 0 0; Since my image is covering more area. the rotation is not working as i want. My screen shot goes here I have […]

Get token from local storage, make http request and return oberservable in Ionic 2

I am making HTTP requests with simple token auth in my Ionic 2 app. The token is stored in local storage. Now when I make a request, I need to get the token from the local storage, make the request and then return the observable: getRides() {‘token’).then((token) => { var headers = new Headers(); headers.append(‘Authorization’, ‘Token token=’ + token); return this.http.get(URL, { headers: headers }).map(res => res.json()) }); } But since the return is […]

How to display JS objects in view

There is already a question from our friend Vinicius Scaramel with this problem, but there is no answer solution, so come on: I’m getting an object in JSON format via http.get on Ionic, (using AngularJS), but when viewing it in the view with {{}} it only displays [object Object], and it does not display my object itself. I’m already losing my hair trying to solve. Let’s code it: Role of my provider who gives the […]

ng-model doesnt update values

I am developing an ionic app based on angular 1 and ionic 1, I have two text boxes with ng-model property set. Basically I want to change value of the other text box if either of their values are changed. The problem is that it works fine, when I change value in text-box-1, the value in text-box-2 changes, but the moment I change text-box-2, it doesn’t reflect the change in text-box-1 and vice-versa. I tried […]

Communication between app.component.ts and another component angular 2

I am a beginner in Angular 2 since I want to move my app from angular 1 to something more efficient. And I don’t understand how to make a communication between two components available. My case is I think special because I want to send some data from my app.component.ts to home.ts. These two classes are not in the same directory. Here is the architecture of my app : >src > app – app.component.ts //where […]

I’m using angular-pdf-viewer for PDF Preview but using PDFJS.getDocument gives no-cors error. How to fix this?

I’m using this library on my Ionic Project And I’ve used this code to load a document PDFJS.getDocument(‘http://localhost/books/book.pdf’).then(function(pdf_doc) { console.log(pdf_doc); }); But I’m getting this error whent trying to load a pdf document in Ionic V1. How can I solve this Fetch API cannot load http://localhost/books/book1.pdf. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:8100’ is therefore not allowed access. If an opaque response serves your needs, set the request’s mode to […]

How to compress image size before uploading using php

I already searched lots of stuff, some of them are from stackoverflow. But none of them helped me. What I want to do is reduce the image file size, and after reducing the image will now be uploaded. Here’s my current code: <?php include ‘cloud_functions.php’; // GET THE USER’S ID $userid = _clean($con, $_POST[‘userid’]); if(!is_dir(“uploads/user/”.$userid.”/”)){ mkdir(“uploads/user/”.$userid.”/”, 0755); } $temp = explode(“.”, _clean($con,$_FILES[“file”][“name”])); $targetPath = “uploads/user/”.$userid.”/”; // RENAME THE IMAGE USING ROUND(); $newFN = round(microtime(true)) . […]

Is it possible to store the translation table in localstorage with angular-translate for an offline use of my app?

I’m developing a multi-language app with Ionic and angular-translate. I get the translation table from a server with $translateProvider.useStaticFilesLoader. It works like a charm as long as the app has an internet connection. The problem is that the client could use the app offline and of course, when you launch the app without internet, it breaks cause translations are not available. Does anyone knows if it’s possible to store the translation table in localstorage (or […]

Firebase auth or angular2-token?

For a mobile and rails API is better use firebase auth or angular2-token for authentication? Seems that Firebase Auth is more suited for mobile with ionic but if you would like to use Rails API as backend to provide a web service with Angular? so, please give your thoughts! Source: AngularJS

How to access values from fire base in ionic2?

I am working on this ionic app where I access a person’s current location, and get the closest place stored on the app’s fire base based on longitude and latitude. However, I don’t know how to access the longitude and latitude values using typescript of each place stored, in order to compare them. Here is a part of my database: place Cart latitude: 29.8898056 longitude: 31.2294537 name: “Cart” phone: “01000987062” Esma latitude: 29.9442674 longitude: 31.1173287 […]

Next Page »