0
votes

Sorry, my English is not good enough to describe more complex things, but I will do my best.

I'm going crazy. I just want to define a default content for an outlet in Ember.js, but I don't find any solution. The examples I found use url matching, but in my case there is no special URL to recognize the default template.

Let's see:

application    <-- the application frame, contains an outlet
/              <-- the index, contains also an outlet
/foobar        <-- some other stuff, which will be rendered in the outlet of index, if the URL is set => that works!

My problem is to render a default template to the outlet of index, if URL == '/'

Any suggestions?

1
What exactly do u mean by default? '/' normally refers to the application + index template. Do you have a bin example to demonstrate ur issue?blessenm

1 Answers

0
votes

I think I understand what you are looking for.

In your template, create a script with ID set to "index". Anything in that script should show when your 'default' URL loads.

 <script type="text/x-handlebars" id="index">
   Welcome to my Ember.js site!
 </script>

and make sure that in your script ID'd with "application" you have an outlet set.

 <script type="text/x-handlebars" id="application">
    <div>
     Testing 1..2..3...
    </div>
    <div>
      {{outlet}}
    </div>
 </script>

Hope this helps.