-
Notifications
You must be signed in to change notification settings - Fork 19
Better example #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- Searchable select2 - Dynamic table display - App container - Grunt Watch
Conflicts: src/index.html
Allow testing of optimized version as well as dev and auto compile when developing.
src/js/main.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why create a global Backpain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This follows the App.* pattern I saw in some backbone google projects and rendr airbnb. The global Backpain is the naming space to allow sharing things across routes/views without passing references around. In this example if we require ('backpain/app') we will gain access to the namespace and can access anything inside it like the router or views or models.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, namspacing is good but we have requried, we shouldn't need to bind it
to window. To use backpain, you do var Backpain = require('backpain') and
get the handle that way, regardless of where.
On Mon, Oct 28, 2013 at 11:37 AM, Jason Ho notifications@github.com wrote:
In src/js/main.js:
Backpain.initialize(); });window.Backpain = Backpain;This follows the App.* pattern I saw in some backbone google projects and
rendr airbnb. The global Backpain is the naming space to allow sharing
things across routes/views without passing references around. In this
example if we require ('backpain/app') we will gain access to the namespace
and can access anything inside it like the router or views or models.—
Reply to this email directly or view it on GitHubhttps://github.com//pull/2/files#r7251844
.
Erik LaBianca - CTO - WiserTogether Inc. | 202-503-3751
For timely health content, "Like" us on Facebook at
http://www.facebook.com/mywiserhealth
|
In general, this looks great. We should get the build to pass. Also, check out the require configuration model in nag ini -- it eliminates much of the duplication in the main.js and allows it to be shared across karma, grunt optimize, etc. |
|
I check the build and require configuration model now. |
Updated example with ideal file structure for backbone projects.
In-Depth example of search and rendering a table on search.
View Cleanup.
Use of auto compile for ease of testing optimized code on index.html and development on dev.html
Updated to current standards.