ionic-framework

Detect Screen Off / On in Cordova and Ionic

自古美人都是妖i 提交于 2020-01-02 05:31:10
问题 I want to detect when the phone is locked and unlocked. The plan is to display a (non-Ad) popup when the phone is unlocked. So far Cordova seems to only support pause and resume events which will not get me the functionality that I need. Native Android supports screen On/Off and User Present events. Is it possible to use these events and if not is it possible to build a plugin to gain that same functionality? Thanks in advance. 回答1: For android you will have to use this plugin template to

Testing IOS apps on ios devices made using IONIC and angularJS

痴心易碎 提交于 2020-01-02 04:54:16
问题 I am making an app made using IONIC which I just want to test on my IOS device, not publish it to the app store. Do I still need an Apple developer account ( by paying $99 ) or is MAC with XCODE and IONIC installed enough? I just want to test it on my device, not publish it to the app store. 回答1: Yes it is possible. I tried this today. Using XCODE 7 beta 2. Tested my project made using IONIC with only APPLIE ID, NOT APPLE DEVELOPER ACCOUNT, and its working. All you have to do is( for making

Ionic framework - command 'grunt serve' returns 'multiple addresses available' and freezes

蹲街弑〆低调 提交于 2020-01-02 04:49:05
问题 Used Yeoman ionic-generator https://github.com/diegonetto/generator-ionic Where I ran it without sass, default plugin list and blank. And when running grunt serve I get the following: Multiple addresses available. Please select which address to use by entering its number from the list below: 1) 192.168.1.69 (en0) 2) localhost Address Selection: When I type 2 in terminal and return it just hangs there without going further or launching a browser. I have tried also typing localhost or

AngularJS reinitialize controller

百般思念 提交于 2020-01-02 04:15:13
问题 I have got a controller named newGroupCtrl whose definition is like : .state('new_group', { url: '/new_group', templateUrl: 'templates/new_group.html', controller: 'newGroupCtrl' }) .controller('newGroupCtrl', function ($scope, $rootScope,$ionicHistory,$window) { $rootScope.roomId = $scope.getRoom(); $scope.getRoom = function () { var date = new Date; var minutes = date.getMinutes(); var hour = date.getHours(); return 'room_' + hour + '' + minutes; }; } I reach this contoller from previous

Using external url in ng-include in AngularJS

我的梦境 提交于 2020-01-02 03:44:06
问题 I have a problem in hand in AngularJS and need some pointers. I have a view where I want to embed an external url (e.g. http://www.w3schools.com). The embeded html page should respond to events like click and touch like a normal html page. I have used ng-include directive to get that working. Here is a code snippet: <ion-content> <div ng-include src="'http://www.w3schools.com'"</div> </ion-content> If I load the external html, I am getting the external webpage loaded, but all the links inside

Working with non ionic-native plugins in Ionic 2

☆樱花仙子☆ 提交于 2020-01-02 03:37:06
问题 I'm using a custom cordova plugin (https://github.com/VJAI/simple-crypto), not available in ionic native. I'm using Ionic 2 and have installed the plugin using the command: cordova plugin add https://github.com/VJAI/simple-crypto The interface is like this: var rncryptor = cordova.require("com.disusered.simplecrypto.SimpleCrypto"); rncryptor.encrypt(key, data, successCallback, failureCallback) rncryptor.decrypt(key, data, successCallback, failureCallback)` Method 1: I have tried to invoke the

Change NavBar color for all the pages in ionic

▼魔方 西西 提交于 2020-01-02 03:33:29
问题 I am new in ionic and wants to learn it. my question is How to change nav bar color for all the pages in ionic 3. I have been using following code <ion-header> <ion-navbar color="primary"> <button ion-button menuToggle> <ion-icon name="menu"></ion-icon> </button> <ion-title>Hello Ionic</ion-title> </ion-navbar> </ion-header> Is there any way to change nav bar color for all the pages instead of manually doing <ion-navbar color="primary"> 回答1: Add following line to variables.scss file to change

Can you add Bootstrap to a Ionic App?

拥有回忆 提交于 2020-01-02 03:29:16
问题 I am currently developing an Ionic app and I was wondering if I could add an image gallery based on Bootstrap. I know Ionic and Bootstrap don't work really well together, but I was wondering if it is possible. 回答1: According to this article Ionic + Twitter’s Bootstrap CSS Framework - Again!, it will be a lot of effort using bootstrap. However I found this slider for you How to Create Elegant Slider Carousel in Ionic Framework. I hope it helps you! Good luck! ;) 回答2: Step 1: Install bootstrap:

Ionic 4 - Angular 6: How to control Ionic router history to stop cache a view component?

放肆的年华 提交于 2020-01-02 02:31:08
问题 Maybe I am missing something, but I'm experiencing a problem with Ionic caching views previously visited, preventing the components from being re-initialized by Angular. The components are pulled from some cache and rendered as whatever data existed previously. Example : User A is logged into the application and starts on the 'Home' page with info relevant to user A. User A logs out and navigates to 'Log In'. User B logs in from the same application and navigates to 'Home' page. Ionic see's

Typescript Error: Property 'files' does not exist on type 'HTMLElement'

廉价感情. 提交于 2020-01-02 02:28:09
问题 I wish to create an upload function for my Apps by using IONIC. Here is my HTML code: <input ion-button block type="file" id="uploadBR"> <input ion-button block type="file" id="uploadIC"> <button ion-button block (click)="upload()">Confirm Claim Restaurant</button> Here is my upload() function: upload(){ let BR = document.getElementById('uploadBR').files[0] let IC = document.getElementById('uploadIC').files[0] console.log(BR) console.log(IC) } In normal HTML it should work, but it doesn't