-
Notifications
You must be signed in to change notification settings - Fork 13.5k
-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cordova.js not found. #486
Comments
this will be aded by phonegap when you compile it for ios, android or whatever. |
phonegap build will add this file |
So this is expected behavior when using ionic in the browser? |
I ran |
There is no issue with ionic, this is the good behavior. The cordova.js file is added when you compile your app with cordova.js is only useful for phonegap, if you are using your app in a browser you don't care about this file. |
Right... so running from |
Would be nice if there was a way to not attempt to include that file if it is not a result of a build step... |
yep you are right. it really depends on your needs, are you writing a mobile native app? I am not sure, but as I said, Ionic is focused right now on mobile native app, not on browser. So it is logical to have this file because you are going to compile your device for one or multiple platforms. you should read http://cordova.apache.org/ |
Of course Ionic is targeted at mobile apps, but common developer workflows will at some point always resort to using a browser for testing and debugging, not only because Safari (with UIWebview Inspection) is lacking the deep-end debugging tools required for hard-core performance optimizations that for example chrome developer tools have (etc., high resolution frame inspection or Angular Batarang). You solve that by 1. always wrapping calls to cordova functions into generalized Cordova Wrapper functions (e.g., checking if cordova is available, if so, produce navigator.notification.alerts instead of plain alert(), see the talk be C. Conraets given recently) and first of foremost only including cordova.js if a Webview environment has been detected. These are only some of the experiences i made in a very large project, ongoing, targeting iOS & Android using Angular & Cordova. But these features can easily be added to Ionic. |
Great discussion. Right now Ionic is focused only on Cordova built mobile apps. The nice thing about this is it lets us do lots of gesture based UI that the browser unfortunately breaks for mobile web apps (like side menus that Chrome and Safari use for switching tabs/going back). If you aren't relying on Cordova features, this script error is harmless. However, if you need cordova available when running the app, I suggest using the simulator or running on the device. Another alternative is to use the Ripple Emulator which basically mocks the phonegap/cordova API, but it hasn't really be updated recently AFAIK. We've got a ton of things planned with Ionic, and making a great test environment that helps you develop cordova based apps without the cordova build/emulate/run cycle is on that list, so stay tuned! |
I also ran into this right away as my app does need some Cordova features. Will need to jury-rig it for now but it would be great if there were a slick way to handle this so I can do most of my testing in Chrome. |
One option is to use the Ripple emulator which emulates some of the stuff. On Wed, Feb 12, 2014 at 10:50 AM, Matthew notifications@github.com wrote:
|
Cordova.js is not needed while testing on the browser. It gets auto included while deploying on a real device/emulator. |
how can I debug android app + plugin push notification , seem It can not debug on browser (ionic serve) , right? How can I see console.log when ionic run android cmd. script src="lib/ngCordova/dist/ng-cordova.js" Then ionic serve show error log cordova is not defined. |
Comment in IONIC Slidemenu exemple: cordova script (this will be a 404 during development) =) |
I just created an app using
ionic create
command. Then I start the app for viewing in the browser like so:When I access the app in the browser everything looks fine, except that I get the following error.
Any idea what the deal is?
The text was updated successfully, but these errors were encountered: