ionic-framework

Using $scope into a service

谁说我不能喝 提交于 2019-12-25 08:26:10
问题 What I expect from below code is it would bind $scope.as . But nothing is displaying and no error is shown in console var testModule = angular.module('testmodule', []) .controller('ctrl', function ($scope, mser) { mser.aa(); }) .service('mser', function($scope /* Would $scope be here */) { this.aa = function(){ $scope.as = "hello mars" }}); 回答1: you can't use $scope in service you should use it in your controller it is used to glue controller and DOM. Since services are injected in

Authenticate Web UI using OAuth2 Access Token from ADFS

霸气de小男生 提交于 2019-12-25 08:23:11
问题 In an Ionic mobile app, we need to access the web API and to show a Web UI (both SharePoint) in an Ionic WebView (essentially a browser inside the app). We're using OnPrem ADFS on Windows Server 2012 and OnPrem SharePoint 2013. Here's what we do: 1. In ADFS3, Setup OAuth2 and add a Relying Party Trust and a Client http://www.gi-architects.co.uk/2016/04/setup-oauth2-on-adfs-3-0/ 2. From the mobile app, call ADFS to obtain an OAuth Access Token First, GETing: https://myadfsdomain/adfs/oauth

How to dismiss all popups at the platform resume?

早过忘川 提交于 2019-12-25 07:45:32
问题 In my application, I have this alert: let confirm = this.alertCtrl.create({ title: 'Blabla', message: 'blablabla', buttons: [button1, button2, button3], enableBackdropDismiss: false }); confirm.present(); Also, when the application is resumed, the application should redirect to login page. No problem in making that work. The problem comes, when I open the popup and resume the application. The application does redirect correctly, but the popup remains opened. Is there a solution to

The BarcodeScanner plugin in ngCordova doesnt work in Android 6

爱⌒轻易说出口 提交于 2019-12-25 07:40:33
问题 I'm developing in Ionic Framework.The barcodeScanner plugin(ngCordova) doesn't work for the newest version of Android. I suspect the plugin is not updated for this version. Any of you have found a solution? Thanks. 回答1: Samuel Paredes, There is many change in Android 6(M) , the main is runtime permissions, so we need the camera for the barcode scanner , but the plugin is not yet updated for that so we need to On the Camera permisson for the application manuully. Setting >> APP manager >> Your

convert string csv to array on angular

◇◆丶佛笑我妖孽 提交于 2019-12-25 07:26:13
问题 I am using factory to download the file csv and parse it to array. I am trying using angular-csv-import to parse my string to array. My string looks like: name,total,table,active ↵דווד,2,1, ↵יוליק גו…, ↵בוריס וטניה ,2,25, ↵גיצה איגור,2,25..... and my code is: DownloadFile.all().then(function (fileArray) { $scope.csv = { content: fileArray, header: true, headerVisible: true, separator: ',', separatorVisible: true, result: null, encoding: 'ISO-8859-1', encodingVisible: true }; then I am using:

Ionic: Subheader is not displayed in tabs-based app in Android

孤人 提交于 2019-12-25 07:25:45
问题 I am struggling to add subheader into tabs based Ionic application. The problem is that the subheader is not shown in Android, but it is shown in iOS. I want to use subheader for a search bar, so that it is not scrolled away with content bellow it. Steps to reproduce the issue: Create a test app based on tabs project: ionic start subheader-test tabs Modify .\subheader-test\www\templates\tab-dash.html to add subheader on Status tab so that it looks like the file bellow: <ion-view view-title=

Angular method returns as undefined rather than JSON object

扶醉桌前 提交于 2019-12-25 06:51:49
问题 I have a getUser method within an Authentication provider (working in Ionic 2): getUser(uid: string): any { var toReturn; firebase.database().ref('/userProfile').orderByKey().equalTo(uid).once("value", function(snapshot){ toReturn = snapshot.val(); console.log("getUser = " + JSON.stringify(toReturn)); }); return toReturn; } It retrieves a user object from firebase. It gets output correctly with the console.log providing it exists and is saved in the toReturn variable. Below is the

Cant access a view within a state in angular-ui-router

好久不见. 提交于 2019-12-25 06:46:14
问题 I am trying to link to a substate and can't figure out how to get it to work. Here is the link: <a ui-sref="tab.communityDashboard" class="button button-block button-large"><i class="icon ion-home"></i><br />Community Directory</a> and here is the route: .state('tab', { url: '/tab', abstract: true, templateUrl: 'templates/tabs.html' }) // Each tab has its own nav history stack: .state('tab.communityDashboard', { url: '/communitydashboard', views: { 'tab-communityDashboard': { templateUrl:

ionic app: file url: system open with dialog

馋奶兔 提交于 2019-12-25 06:45:24
问题 Is it possible to show a native "Open With" dialog suggesting recommended apps, when the user taps on a http link (to a file download) in an ionic application? Thanks, Anil 回答1: Yes, it is possible. Simply you can use Cordova InAppBrowser to implement it. Try below code after adding plugin: cordova.InAppBrowser.open(file_link, '_system', "location=yes"); To be more specific you can use some other plugins such as cordova-plugin-fileopener . 回答2: If there are more than an installed app which

How to sign android apk without android studio

和自甴很熟 提交于 2019-12-25 06:44:41
问题 I have found many many confusing answers on this one: How do I sign (release/debug) android app without Android Studio (E.g. when signing ionic/cordova/phonegap app)? 回答1: You can Add Key store in Gradle file. android { ... defaultConfig { ... } signingConfigs { release { if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) { storeFile file(MYAPP_RELEASE_STORE_FILE) storePassword MYAPP_RELEASE_STORE_PASSWORD keyAlias MYAPP_RELEASE_KEY_ALIAS keyPassword MYAPP_RELEASE_KEY_PASSWORD } } }