FileTransfer is not defined - angularjs

I am using Transfer plugin in my ionic 2 app for sending files. While testing the app, I had difficulty in mocking Transfer. Please take a look into this problem to understand the context . After that discussion , I decided to inject Transfer in my service.
So I added Transfer in my providers in app.module.ts.And injected it into my service.
constructor( public transfer: Transfer){}
But this leads to an error. FileTransfer is not defined. I guess its because there is no browser support for this plugin. So I am in a tough spot, I do not know how I can make working testable code. Any ideas?

In ionic cordova plugin are not supported for browser Because the browser cant access native api of the os so you need to develop the app and deply it in your Android or ios device .

Related

Is it possible to run angular js app directly on mobile

i just want to know that is it possible to run angularjs app on mobile directly means without using web browser??
I search google and it seems i can't but my client want to do that.
you could also use Ionic Framework (ionicframework.com) for this as it is heavily using Angular and encapsulating everything in real mobile apps that are capable of being deployed via App Stores (Play Store, iTunes, ...).
Best regards,
Steviee
You can use Cordova Framework Which generates mobile application in android and ios also for that you can refer -https://cordova.apache.org/docs/en/latest/
Follow this documentation step and you get all files with proper structure in that you can write your application code.
Try angular bundler for cordova.
abc framework - https://github.com/thruthesky/abcframework which gives you a great convenient building mobile apps using Angular.
abc is Angular Bundler for Cordova which helps you building mobile apps with Angular.

Angular App to AppGyver- Port to Mobile Solution

I'm beginner to appgyver steroids.
I have angular project. Now I need to make iOS application using AppGyver.
Instead of modify root view and point it to my angular app url (http://www.yourapp.com) can I add my angular app source / angular project build to AppGyver project make it iOS application.
Appreciate your comments
Gayan
You can run steroids create yourApp. This will walk you through the generation of a multi page or single page application. You can then move the structure of your angular application into the /app folder. Check out the example that the steroids create method generates and see the structure there.
You may notice some differences at first. It may take some testing to see what is failing if anything once you port things over. If you used $rootScope for anything it is not as reliable in my experience in an iOS or Android application. There are other methods for passing data between views and broadcasting (publish/subscribe) to other controllers.
You will want to use the iOS simulator or http://localhost:4567/app/moduleName/oneOfYourViewsYouAreTesting.html in your favorite browser while steroids connect is running to debug.
The version of Angular that is coming with this now is AngularJS v1.3.15 installed via bower. You may want to verify things are compatible with your current Angular version.
Ionic is used and Supersonic so you may see conflict with existing CSS or even javascript depending on what you've implemented.
There will be some tricks to learn about preloading views in the structure.coffee file and load times / rootView / initialView. There is lots of support if you come across any issues.
This forum has been really helpful in figuring out any issues I've come across. The Appgyver team is usually pretty responsive to questions directly as well.
They are updating the platform in a few days, and they say big changes are coming. They are hiring a lot of developers right now to take care of GitHub issues as well as build out the rest of their incomplete components.

AngularJS Access denied when loading partial in IE11

Background
I am attempting to develop an AngularJS app that is to be hosted as 'offline html' as part of the Resco MobileCRM software. This software provides offline access to CRM data via its own javascript libraries and this is working fine. I am also able to get a very simple angularjs application working, in terms of retrieving and displaying the data.
The AngularJS application is uploaded to the CRM using the Resco interface and then is download to each client machine via the resco software. The actual files end up in the users AppData folder on each client machine.
Problem
When I introduced routing to the angular app, either using ngRoute or ui-router, I am getting Access Denied errors. The resco software uses the underlying browser, which in my case is IE11. I have narrowed down the error to when angular is attempting to load the partials for the routes.
The offending code is below (angular.js v1.3.15 line 9805)
xhr.open(method, url, true);
From my research, it seems like IE believes I am attempting a CORS request, however I am just attempting to load a file from disk.
Various posts suggest I add the site to 'Trusted Sites', however I am not actually accessing another site. I also cannot host this on a web server as the whole purpose is to have this angular application accessible offline within the Resco MobileCRM application
I also get the same error if I navigate to the AppData folder and run the angularjs application directly from there (i.e. not in the resco application).
Other posts have suggested that I need to replace the XMLHttpRequest created by Angular with XDomainRequest but I am reluctant to change the angular library, especially if I don't understand why.
Would appreciate it if anyone could shed some light on why this is happening and how to fix it.
I have confirmed that this is not possible on any of the browsers. You cannot make xhr requests to files served locally from disk.
I got around this problem for directives by loading my 'partials' in to script tags and referring to the id of these script tags in the directives.
I did not try that with ui.router or ngRoute and instead opted to redesign my application in to a number of smaller application as they did not need to share any context

Embed yeoman created angularjs application in play framework

My target software architecture:
Backend-application (RESTful http API, responding JSON)
Play Framework (v2.3.8)
Frontend-application (requests the backend-application and renders the result)
AngularJS App
Yeoman scaffolded (angular-generator)
My question:
I want to host the angularjs inside the play application. How can I
achieve that?
(I don't want to create a second app and host it with grunt serve since this causes problems because of the 'same origin policy')
You could use Play Yeoman. Here is a small example application which shows a simple implementation.

Cordova and Angular on iOS not getting data from Firebase

The gist of it is, check wifi on all devices before hoping to test cloud data
That said, Rob DiMarco's suggestion of using Firebase.enableLogging(true) is an invaluable suggestion to empowering firebase users that may have missed that in the docs. (crud happy muts that we are)
Anyone have experience hooking up an Angular / firebase app into phonegap's ios platform? Data was coming in yesterday, today no data on the ios but works fine minified in the browser. Any insight is appreciated.
Steps taken:
Working, clean angular app with firebase refs binded
Used Grunt to min and concat
installed ionic with ios platform and all cordova plugins
ionic build
ionic run
The app comes in clean, just doesn't load firebase data. One notable difference in our app is that we're filling the data service from angular's run function. The webapp sees the data properly, wondering if that would be the bug..
Step 1: Check your internet before looking for cloud data.
Step 2: Firebase.enableLogging(true), all Firebase data in the console. It's quite beautiful.

Resources