Sharing Top Content from the Angular-sphere.

sevcsik/ Last active Mar 21, 2016

  • // the wrapper function returns the contents of your module,
  • Since you’d need the isAngular branch and the isNode branch anyway, and you’d also need the wrapper function on the front-end, there’s only 4 additional lines needed make your module compatible with both -ends.
  • ( function ( isNode , isAngular ){ // this gets resolved at the bottom of the function before it’s called })( typeof module !

Read the full article, click here.

@tweetdesi9: “Check out a gist for ideas about sharing your modules between #nodejs and #angularjs at #html5 #js #javascript”

They say that one of the pros of NodeJS is that you use the same language on the back-end and the front-end, so it’s easy to share code between them. This sounds great in theory, but in practice the synchronous dependency handling in NodeJS works completely different than any client-side frameworks (which are asynchronous).

sevcsik/ Last active Mar 21, 2016