Skip to content

Conversation

@JasonH1
Copy link

@JasonH1 JasonH1 commented Oct 28, 2013

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.

- 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
Copy link
Contributor

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?

Copy link
Author

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.

Copy link
Contributor

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

@easel
Copy link
Contributor

easel commented Oct 28, 2013

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.

@JasonH1
Copy link
Author

JasonH1 commented Oct 28, 2013

I check the build and require configuration model now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants