Comments (4)
Thanks for your first PR. I will implement this tomorrow.
Out of interest, what's the benefit of grouping your collections?
from meteor-admin.
It keeps the window
object less cluttered on the client, but I only do it in really large apps, and it's not really critical. It's also useful when you're creating the collection in a package and you want to attach everything to a single exported variable. Similar to how Meteor.users
is attached to Meteor
instead of just Users
. You handle the users collection specially, but another package could export in the same way.
from meteor-admin.
@aldeed Could you share the snippet or method you use for parsing strings with '.' to return JS objects?
from meteor-admin.
function lookup(obj) {
var ref = window;
var arr;
if (typeof obj === "string") {
arr = obj.split(".");
while(arr.length && (ref = ref[arr.shift()]));
if (!ref) {
throw new Error(obj + " is not in the window scope");
}
return ref;
}
return obj;
}
That takes either the object itself or a string representation of it with dots. If it's an object, just returns it, otherwise lookup based on the string pieces. It's client-specific, though, so if used in server code, you'd have to detect whether client or server, and change that first line to ref = global
(I think) on the server.
from meteor-admin.
Related Issues (20)
- Meteor 1.4.1.1 - All users page not show users. HOT 1
- No data displayed HOT 1
- Create separate pages for users collection depending on user roles
- Custom menu item title. HOT 1
- Error when running the project - Leading decorators must be attached to a class declaration! HOT 2
- Howto remove "id" field from "new" form? HOT 3
- How can I add Columns to Tables
- Work with generator-angular-meteor ?
- [QUESTION] Where do you add the AdminConfig ? HOT 6
- Determine admin by role
- Change default table length from 10 to 100? HOT 1
- Admin Config... Example not Clear HOT 1
- Role and Permission
- Is this package being maintained HOT 6
- Conflicts with aldeed:collection2-core HOT 2
- How to add 'sub-admin' to custom user groups?
- Remove New
- How to listen the submit event?
- Oops, looks like there's no route on the client or the server for url: "http://localhost:3000/."
- Breaks on Meteor 1.8.1 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meteor-admin.