I am new to phonegap development & I am trying to pick a framework to use. I'd like to use AngularJS as I've read good things about it, but I'd like it to work with Parse.com as a backend. I noticed that one Parse.com they don't specify any compatibility with Angular, and all their documentation and Javascript API requires Backbone.
我是phonegap开发新手,我正在尝试选择一个框架来使用。我想使用AngularJS,因为我读过一些关于它的好东西,但是我希望它可以作为后端来使用Parse.com。我注意到一个Parse.com他们没有指定任何与角的兼容性,他们所有的文档和Javascript API都需要主干。
I know AngularJS supports http, so I can communicate with Parse using the REST API. But is this going to end up being a mess & will I save myself time & stress if I use Backbone with the Parse.com Javascript API instead?
我知道AngularJS支持http,所以我可以使用REST API与Parse进行通信。但是,如果我使用Parse.com的Javascript API来使用主干,这会不会让我节省时间和压力呢?
5 个解决方案
#1
56
I have not worked on Parse, but I believe as long there is a REST API available AngularJS can very well integrate with Parse.com. These links substantiate that fact
我还没有研究解析,但是我相信只要有一个REST API, AngularJS就可以很好地与Parse.com集成。这些联系证实了这一事实
https://parse.com/questions/does-any-know-of-any-angularjs-sites-that-are-built-with-parse-that-are-open-source
http://brandid.github.io/parse-angular-demo/#/
http://brandid.github.io/parse-angular-demo/ /
Said that, AngularJS is a very capable framework with a steep learning curve. The simple stuff is simple but one needs to put ones head down and start learning the not so simple stuff like directives once one starts building any decent size application. The more you invest in learning AngularJS the more rewarding it becomes.
也就是说,AngularJS是一个很有能力的框架,学习曲线很陡。简单的东西很简单,但是当你开始构建任何合适大小的应用程序时,你需要埋头学习那些不那么简单的东西,比如指令。你在学习AngularJS上投入越多,收获就越多。
It has a very clean separation in terms of view and code. The code is further organized into modules, factories, services, controllers, directive, filters etc.
它在视图和代码方面有非常清晰的分离。代码被进一步组织成模块、工厂、服务、控制器、指令、过滤器等。
But still nothing stops you from creating a mess with the implementation :) What I have realized over the time is even if you create mess within AngularJS the effects are localized rather than affecting the complete application, due to the modular nature of Angular.
但是仍然没有什么能阻止您对实现创建一个混乱:)我已经意识到,即使您在AngularJS中创建混乱,由于角度的模块化特性,效果是本地化的,而不是影响整个应用程序。
I suggest you try creating or looking at some samples with AngularJS (such as TodoMVC)
我建议您尝试使用AngularJS(例如TodoMVC)创建或查看一些示例
This is how i felt learning and implementing AngularJS solutions
这就是我学习和实现AngularJS解决方案的感觉
#2
18
Thanks for bring up our Parse x AngularJS boilerplate - we've just updated it today too.
感谢您带来我们的解析x AngularJS样板-我们今天也更新了它。
Our entire site getbrandid.com is built with Parse x AngularJS and no servers of our own.
我们的整个站点getbrandid.com是用解析x AngularJS构建的,没有自己的服务器。
We built this boilerplate after because having spent a few years building BRANDiD, we had a lot of best practices to share with the Parse and AngularJS communities. We think it is a match made in heaven, and is the fastest way to build powerful complex, highly maintainable serverless apps.
我们在花了几年时间构建BRANDiD之后构建了这个样板文件,我们有很多最佳实践可以与Parse和AngularJS社区共享。我们认为这是天作之合,是构建强大、复杂、高度可维护的无服务器应用程序的最快方式。
We've basically extended the Parse SDK to support AngularJS bindings, we've eliminated a ton of boilerplate code, and most importantly, we've established an architecture for large serverless apps using Parse and Angular.
我们基本上已经扩展了解析SDK以支持AngularJS绑定,我们已经消除了大量的样板代码,最重要的是,我们已经为使用Parse和angle的大型无服务器应用程序建立了一个体系结构。
I highly encourage you to check it out -
我强烈建议你去看看
解析x AngularJS样板
#3
11
Actually Parse
's documentation does not say that you have to use Parse
with Backbone
, it just says that some stuff are compatible with Backbone
classes, like the Collections
object, which might be useful ONLY IF you use Backbone
.
实际上,Parse的文档并没有说必须使用带主干的Parse,它只是说有些东西与主干类兼容,比如Collections对象,这可能只有在使用主干时才有用。
The big hassle of using 3rd party stuff inside angular is its lifecycle, as it uses POJOs and only watches for changes in these objects at specific points in time - Check the Scope Life Cycle
documentation for more info.
在角度内使用第三方内容的最大麻烦是它的生命周期,因为它使用pojo,并且只在特定的时间点监视这些对象的更改——查看范围生命周期文档以获得更多信息。
Given that, when Parse
returns its callbacks, AngularJS
might no longer be observing those Parse
objets, so you need a way of telling angular that thing changed, and you have to do it inside the digest loop, for example using $scope.$apply
既然这样,当Parse返回回调时,AngularJS可能不再观察那些解析objets,所以您需要一种方法来告知那个东西发生了变化,您必须在digest循环中执行,例如使用$scope.$apply
I created a small wrapper for Parse.Query
and Parse.Object
to avoid the need for $scope.$apply
all the time, let me know if you find it useful: https://github.com/felipesabino/angular-parse
我为Parse创建了一个小包装器。查询和分析。对象,以避免对$scope的需要。$apply始终,如果您觉得它有用,请告诉我:https://github.com/felipesabino/angular-parse
#4
1
The easiest way I found to communicate with the parse.com backend is to use the jimrhoskins/angular-parse Angularjs module that replaces the (backbone) ParseSDK.
我发现与parse.com后端进行通信的最简单方法是使用jimrhoskins/angular-parse Angularjs模块来替换(主干)ParseSDK。
Ads instant :-) I included it in this angular/parse boilerplate.
ad instant:-)我把它包含在这个角度/解析样板中。
#5
1
We've been using this method fairly frequently. We decided to document our experience. Its a 2 part series on building angular apps with a parse backend. Hope it helps!
我们经常使用这个方法。我们决定记录我们的经验。这是一个包含2部分的系列,介绍如何使用解析后端构建有棱角的应用程序。希望它可以帮助!
#1
56
I have not worked on Parse, but I believe as long there is a REST API available AngularJS can very well integrate with Parse.com. These links substantiate that fact
我还没有研究解析,但是我相信只要有一个REST API, AngularJS就可以很好地与Parse.com集成。这些联系证实了这一事实
https://parse.com/questions/does-any-know-of-any-angularjs-sites-that-are-built-with-parse-that-are-open-source
http://brandid.github.io/parse-angular-demo/#/
http://brandid.github.io/parse-angular-demo/ /
Said that, AngularJS is a very capable framework with a steep learning curve. The simple stuff is simple but one needs to put ones head down and start learning the not so simple stuff like directives once one starts building any decent size application. The more you invest in learning AngularJS the more rewarding it becomes.
也就是说,AngularJS是一个很有能力的框架,学习曲线很陡。简单的东西很简单,但是当你开始构建任何合适大小的应用程序时,你需要埋头学习那些不那么简单的东西,比如指令。你在学习AngularJS上投入越多,收获就越多。
It has a very clean separation in terms of view and code. The code is further organized into modules, factories, services, controllers, directive, filters etc.
它在视图和代码方面有非常清晰的分离。代码被进一步组织成模块、工厂、服务、控制器、指令、过滤器等。
But still nothing stops you from creating a mess with the implementation :) What I have realized over the time is even if you create mess within AngularJS the effects are localized rather than affecting the complete application, due to the modular nature of Angular.
但是仍然没有什么能阻止您对实现创建一个混乱:)我已经意识到,即使您在AngularJS中创建混乱,由于角度的模块化特性,效果是本地化的,而不是影响整个应用程序。
I suggest you try creating or looking at some samples with AngularJS (such as TodoMVC)
我建议您尝试使用AngularJS(例如TodoMVC)创建或查看一些示例
This is how i felt learning and implementing AngularJS solutions
这就是我学习和实现AngularJS解决方案的感觉
#2
18
Thanks for bring up our Parse x AngularJS boilerplate - we've just updated it today too.
感谢您带来我们的解析x AngularJS样板-我们今天也更新了它。
Our entire site getbrandid.com is built with Parse x AngularJS and no servers of our own.
我们的整个站点getbrandid.com是用解析x AngularJS构建的,没有自己的服务器。
We built this boilerplate after because having spent a few years building BRANDiD, we had a lot of best practices to share with the Parse and AngularJS communities. We think it is a match made in heaven, and is the fastest way to build powerful complex, highly maintainable serverless apps.
我们在花了几年时间构建BRANDiD之后构建了这个样板文件,我们有很多最佳实践可以与Parse和AngularJS社区共享。我们认为这是天作之合,是构建强大、复杂、高度可维护的无服务器应用程序的最快方式。
We've basically extended the Parse SDK to support AngularJS bindings, we've eliminated a ton of boilerplate code, and most importantly, we've established an architecture for large serverless apps using Parse and Angular.
我们基本上已经扩展了解析SDK以支持AngularJS绑定,我们已经消除了大量的样板代码,最重要的是,我们已经为使用Parse和angle的大型无服务器应用程序建立了一个体系结构。
I highly encourage you to check it out -
我强烈建议你去看看
解析x AngularJS样板
#3
11
Actually Parse
's documentation does not say that you have to use Parse
with Backbone
, it just says that some stuff are compatible with Backbone
classes, like the Collections
object, which might be useful ONLY IF you use Backbone
.
实际上,Parse的文档并没有说必须使用带主干的Parse,它只是说有些东西与主干类兼容,比如Collections对象,这可能只有在使用主干时才有用。
The big hassle of using 3rd party stuff inside angular is its lifecycle, as it uses POJOs and only watches for changes in these objects at specific points in time - Check the Scope Life Cycle
documentation for more info.
在角度内使用第三方内容的最大麻烦是它的生命周期,因为它使用pojo,并且只在特定的时间点监视这些对象的更改——查看范围生命周期文档以获得更多信息。
Given that, when Parse
returns its callbacks, AngularJS
might no longer be observing those Parse
objets, so you need a way of telling angular that thing changed, and you have to do it inside the digest loop, for example using $scope.$apply
既然这样,当Parse返回回调时,AngularJS可能不再观察那些解析objets,所以您需要一种方法来告知那个东西发生了变化,您必须在digest循环中执行,例如使用$scope.$apply
I created a small wrapper for Parse.Query
and Parse.Object
to avoid the need for $scope.$apply
all the time, let me know if you find it useful: https://github.com/felipesabino/angular-parse
我为Parse创建了一个小包装器。查询和分析。对象,以避免对$scope的需要。$apply始终,如果您觉得它有用,请告诉我:https://github.com/felipesabino/angular-parse
#4
1
The easiest way I found to communicate with the parse.com backend is to use the jimrhoskins/angular-parse Angularjs module that replaces the (backbone) ParseSDK.
我发现与parse.com后端进行通信的最简单方法是使用jimrhoskins/angular-parse Angularjs模块来替换(主干)ParseSDK。
Ads instant :-) I included it in this angular/parse boilerplate.
ad instant:-)我把它包含在这个角度/解析样板中。
#5
1
We've been using this method fairly frequently. We decided to document our experience. Its a 2 part series on building angular apps with a parse backend. Hope it helps!
我们经常使用这个方法。我们决定记录我们的经验。这是一个包含2部分的系列,介绍如何使用解析后端构建有棱角的应用程序。希望它可以帮助!