使用骨干机型AngularJS [英] Using Backbone models with AngularJS

查看:112
本文介绍了使用骨干机型AngularJS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我在想Backbone.js的和AngularJS之间的异同。

Recently I was thinking about the differences and similarities between Backbone.js and AngularJS.

我觉得在什么真正骨干是方便的骨架模型和骨干的集合。你只需要设置urlRoot,然后通过Ajax后端服务器通信基本工作原理。

What I find really convenient in Backbone are the Backbone-Models and the Backbone-Collections. You just have to set the urlRoot and then the communication with the backend-server via Ajax basically works.

难道不应该有可能仅使用的骨架模型和集合在AngularJS应用程序?
因此,我们将有两全其美通过骨干网的模型AngularJS和服务器端方便的访问(或其他存储选项)和集合双向数据绑定的。

Shouldn't it be possible to use just the Backbone-Models and Collections in AngularJS application? So we would have the best of both worlds two-way data-binding with AngularJS and convenient access to the server-side (or other storage options) through Backbone-Models and Collections.

有一个快速的互联网搜索没来任何网站提示这种场景。
所有的资源,无论是谈论使用任一种或另一种框架。

A quick internet search didn't turn up any site suggesting this usage scenario. All resources either talk about using either the one or the other framework.

是否有人有利用骨干网的模型或集合与AngularJS经验。
难道他们不会互相配合得好吗?我是不是缺少点什么?

Does someone have experience with using Backbone-Models or Collections with AngularJS. Wouldn't they complement each other nicely? Am I something missing?

推荐答案

工作上面例如结合...
http://jsbin.com/ivumuz/2/edit

a working binding for example above... http://jsbin.com/ivumuz/2/edit

它说明周边的骨干机型正在与AngularJS的一种方式。
但制定者/干将连接效果会更好。

it demonstrates a way for working around Backbone Models with AngularJS. but setters/getters connection would be better.

这篇关于使用骨干机型AngularJS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆