Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to extend namespaces with EmberJS
    primarykey
    data
    text
    <p>I've been programming in Javascript for a while. Recently I made quite a huge jQuery project and applied the Module Pattern as described in this wonderful article: <a href="http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth" rel="noreferrer">http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth</a></p> <p>This all went fine and dandy and the code looks slick and manageable, but I felt it could be better. I've spend the day looking for some Javascript frameworks, mostly ones that:</p> <ul> <li>Have UI binding support</li> <li>Have a templating system</li> <li>Can work with jQuery</li> <li>Help me organize my code in a similar way as I did with the module pattern</li> </ul> <p>I've stumbled across frameworks like AngularJS, KnockOutJS, SpineJS, JavascriptMVC, etc. The one that really sticked out - and was quite praised - was EmberJS.</p> <p>I decided to give it a shot, but it has not been easy. The availability of tutorials for EmberJS is very limited. After trying for a long time I managed to get some stuff running and I like what EmberJS does! There is only one thing I can't seem to figure out - which is also my question: <strong>How can I extend an Ember namespace (made with Ember.Application.create)?</strong></p> <p><strong>For clarification:</strong> The old version of my project had a Core-namespace and a Util-namespace. Both contained their respective functions which all other classes could use. How can I have a Core- and Util-namespace with functions on top of the initial-namespace? </p> <p>Do I just do:</p> <pre><code>MyNamespace = Ember.Application.create(); MyNamespace.Core = Ember.Application.create(); MyNamespace.Util = Ember.Application.create(); </code></pre> <p>Or something else?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload