10

I'm hopeful this issue has already been approached. Does PhoneGap work with AngularJS? Are there any limitations to using them together? Benefits/pitfals? Thanks

1
  • 1
    Just to be clear, I can decidedly state that AngularJS DOES in fact work and work well with Cordova. By using a NodeJS backend and Socket.IO, you can cut development time down significantly by deploying the same codebase to web, mobile, and desktop (AppJS). Commented Feb 17, 2013 at 5:19

7 Answers 7

10

Yes.

I have made multiple applications with PhoneGap plus AngularJS. There's no magic to it.

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks! You are correct! It also works with AppJS (basically phonegap for Windows/iOS using NodeJS as a backend)
@AndrewRhyne I'm new to both phonegap and angularjs, I've tried these tutorials but none seemed to work (they worked on Xcode/ios but not android).. can anyone point me to a repo that has a complete project of angularjs/phonegap on android? thx!
Are you able to develop app for Windows Phone 8 with Phone Gap 3.3 and AngularJS. Asi its my first attempt to develop mobile App. Am unable to load view in ng-view tag
Check out the ng-cordova project which provides services for accessing Cordova plugins: ngcordova.com/docs
3

PhoneGap just runs your application within the native device browser, so if AngularJS is supported on your target platforms, it should work with PhoneGap.

2 Comments

Doesn't phonegap just act as a web browser for your JS/HTML/CSS and expose the backend? I am wondering if Angular's custom HTML attributes are going to cause a problem with PhoneGap
That shouldn't be an issue. Unless, of course, you're developing an app for some kind of magical IE8 mobile phone :)
3

I'm having trouble getting angularjs working on windows phone 7 with phonegap. The simple stiff works, but as soon as I try to add page route...

[Edit]

Ok. So I have found the problem on windows phone 7/8.

in the function matchUrl(url,obj) in angular.js (1.0.3) there is a regex that fails because Windows Phone use an unusual prefix or namespace or whatever it is called (probably for security purposes).

What happens is angular is expecting a url like 'http://localhost/www/index.html' but in windows phone it will look like: 'x-wmapp0:www/index.html' instead.

I tried fixing the regex, but even so I get an error later on from XHR.

2 Comments

Angular seems to have a few issues with IE in general. Currently searching for a work-around. Will post when I find something
What's funny is, it works with IE9. I even tried it with the internet explorer web browser in wp7 and it works (albeit with some slight css problems). It doesn't work with whatever web browser phonegap uses.
2

I've found that the brian t ford article (which everyone references) doesn't really explain how the config file is picked up (which includes the pointer to the index.html file and several other assets) which marks it out as a little out of date. It would be great to get a good update on it.

Comments

1

I am currently working on a project with Phonegap and AngularJS. I do recommend the following reading. Will help you decide if it's what you want in an hour.

http://briantford.com/blog/angular-phonegap.html

AngularJs will let you have the power and structure of a website but it has a small flaw is that it is a bit slow, I say this from experience and it happens that sometimes the models take a while to cool off.

Likewise, I recommend that you take a look at Yeomen, I am currently working on a generator angularJS phonegap and hope to have it for this weekend.

regards

@gartox

1 Comment

That tutorial is so outdated. Wasted my time.
0

Yes. http://ionicframework.com is a framework that integrated Cordova and AngularJS. It will save you a lot of time trying to get everything set up.

To install the framework:

npm install -g cordova ionic

To create new empty:

ionic start myApp blank

All the options available in phonegap are also available in Ionic. For example, you could type

ionic serve

And your mobile app will open right in the browser, and auto-update whenever new changes are made to the files, just like in Phonegap.

Comments

0

From PhoneGap's blog:
http://phonegap.com/blog/2013/07/31/phonegap-30-faq/

Q: Does PhoneGap play well with angular.js? Or any other framework?

A: It sure does. PhoneGap does not dictate how an app gets authored with HTML, CSS, and JavaScript. We play nice with all frameworks and, of late, many are being authored today with Angular.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.