Is there any way to split an Ember.js app across a few files?

后端 未结 4 1693
清歌不尽
清歌不尽 2021-02-02 16:41

I\'ve just written my app.js file and everything is nicely working but the whole file is currently 450 lines long and will be getting bigger.

Is there

4条回答
  •  终归单人心
    2021-02-02 17:04

    I was facing the exactly same question two weeks ago, and I didn't wanted to try AMD with requireJS, which seemed a bit complicated for what I wanted to do (and seemed to have advantages but also disadvantages..)

    The simple solution which convinced me is the following :

    I have 3 folders in my js folder : "models", "controllers", and "views" which contains my js "classes", and I have an "index.html" that import all the js files (I used HTML5 boilerplate to get a convenient index.html).

    To be clear, in my index.html, I have at the end of the file something like :

     
     
     
     
     
     
     
     
     
    

    Hope this help, (and that I didn't misunderstood your question)

提交回复
热议问题