Search Posts

Category: ionic-framework

Changing jQuery to ionic

So I originally had this bit of jQuery code, working perfectly fine: <input type=”text” value=”name-var”/> $(“input”).keydown(function(e) { var oldvalue=$(this).val(); var field=this; setTimeout(function () { if(field.value.indexOf(‘name-var’) !== 0) { $(field).val(oldvalue); } }, 1); }); I have been tasked with making this code in ionic angular, and since I am extremely, extremely new at this, I’m having some trouble. This is what I have so far: @Page({ template: ` <ion-content> <input #orderCommentInput (ngModelChange)=”check()” type=”text” [(ngModel)]=”comment” /> </ion-content> […]

Print using thermal printer via bluetooth in ionic1

I am trying to print order from thermal printer via bluetooth in ionic1 and I just want to by pass print preview option and print direct on click on print button. Please help me in find the way to print. I want the printing app like POS PRINTER DRIVER ESC/POS I also tried to implement this but ad ( POS PRINTER DRIVER’s title ) is showing on top of print receipt and I want to […]

Html input max length makes the text area to be 0

I am using a directive to handle decimal functionality in my html input box as well as i have given the max length for the input type of number to be 5 when i type a value more than 5 digits the existing value in the text box becomes zero can anyone tell me why it occurs or how could i avoid this. Decimal Directive: ‘use strict’; angular.module(‘main’) .directive(‘decimalpoint’, function (CommonService) { ‘use strict’; return […]

Using require() with Ionic V1

I am building an e-commerce mobile application with Ionic V1. I am integrating Instamojo as the payment gateway provider. They provide a npm module for integration with node applications. However, to us this module we have to make use of the require() functionality. var Insta = require(‘instamojo-nodejs’); Insta.setKeys(API_KEY, AUTH_KEY); While trying to use this, I get an error that require is undefined. Can someone, help me out with how to use this in an […]

imgcache.js with ionic1 get TypeError

I have on my project imgcache.js and ionic-img-cache on debug mode it’s look’s good: INFO: ImgCache initialising INFO: LocalFileSystem opened INFO: Local cache folder opened: /ionic-img-cache ionicImgCache initialized but when I work with ion-img-cache-bg and ng-style I get: TypeError: Cannot read property ‘1’ of null at Object.Private.getBackgroundImageURL (imgcache.js:484) at Object.ImgCache.isBackgroundCached (imgcache.js:828) at ionic-img-cache.min.js:1 at processQueue (ionic.bundle.js:29132) at ionic.bundle.js:29148 at Scope.$eval (ionic.bundle.js:30400) at Scope.$digest (ionic.bundle.js:30216) at Scope.$apply (ionic.bundle.js:30508) at done (ionic.bundle.js:24829) at completeRequest (ionic.bundle.js:25027) Thanks! Source: […]

Cannot open external URL on Android device using ionic

I am using Ionic to build an android app. I have an element with ng-click which calls a function doing the following: $, ‘_system’, ‘location=yes’); This should open the device’s default browser with the url. Yet when I run this on an Android device and click the element nothing happens. I have hooked up a debugger and still get no errors in the console and definitely execute that line. Source: AngularJS

Cannot read property ‘childNodes’ of undefined while selecting and deselecting same item from a modal list

I have used a modal list in angular js to show the list of names once a name is selected it will be highlighted and it is touched again it will be deselected.the selection and deselection work fine for the first time but when i select the item again it shows me the error as childNodes of undefined.can anyone tells me why it occurs like this inside a modal. Modal Initialization: function modalFunction (htmlpath) { […]

How to load sprites on phaser based on database data

I am trying to pull img data(just url string) from database to replace it with player sprite url. ionViewDidLoad() { this.profileData = => this.db.object(`profile/${auth.uid}`).valueChanges()); this.profileData.subscribe(profile =>{ this.avatar = profile.avatar; console.log(this.avatar);//i got data(its an url string) }); console.log(‘ionViewDidLoad ZombiePage’); = new Phaser.Game(window.innerWidth, window.innerHeight, Phaser.AUTO, ‘game’, { preload: this.preload.bind(this), create: this.create.bind(this),update:this.update.bind(this),render:this.render.bind(this) }); console.log(window.innerHeight); } preload(){ console.log(this.avatar); //Undefined‘player’, this.avatar); Why i cant reach data from preload function ? btw im using ionic/angular framework.i combined it […]

addEventListener for "offline" firing multiple times in ionic

For some reason, When the application goes into offline mode the event listener is firing multiple times and how to make it fire only once. $rootScope.$on(‘$ionicView.afterEnter’, function (event, view) { $ = navigator.onLine; var popup; $window.addEventListener(“offline”, function () { $rootScope.$apply(function () { $ = false; popup = $ionicPopup.confirm({ title: ‘Network Problem’, content: ‘Sorry, Please Check Your Network Connection.’ }) }); }, false); $window.addEventListener(“online”, function () { $rootScope.$apply(function () { ${ template: ‘<p>Loading…</p><ion-spinner></ion-spinner>’, }); $ = […]

Next Page »