本文介绍了CRUD在AngularJS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立在AngularJS涉及大部分CRUD操作的管理面板。我已经看到了如何做到这一点在网络上的许多例子。我看到每个实施例是一个单页的应用程序处理的单个类型(例如人,雇员等)。

I am building an admin panel that involves mostly CRUD operations in AngularJS. I have seen many examples of how to do this on the web. Each example I have seen is a single page application that handles a single type (for example Person, Employee, etc.).

我的问题是:如果管理应用程序我建设将涉及大量CRUDS(一个数据库中的每种型号),我应该仍然使用一个单一的网页应用程序的整个管理面板网站或应我每做一个CRUD单独的单页的应用程序?

My question is the following: If the admin application I am building will involve a large number of CRUDS (one for each type used in the database), should I still use one single page app for the entire admin panel website or should I make each CRUD a separate single page application?

什么是最好的做法呢?

推荐答案

我们已经选择使用一个单一的应用程序与angular.js叫NG管理员(开源内置多模式管理GUI,见$ C在 $ C)。

We've chosen to use a single app for a multi-model admin GUI built with angular.js called ng-admin (open-source, see code at https://github.com/marmelab/ng-admin).

这工作得很好,而且它更容易处理模型关系(一到多,多到一,多到多)。有几个应用程序,否则将意味着启动多个应用程序 - 可能是坏的webperf

It works very well, and it's easier to deal with model relationships (one-to-many, many-to-one, many-to-many). Doing so with several apps would imply booting several applications - probably bad for webperf.

这篇关于CRUD在AngularJS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 00:59