1

Possible Duplicate:
Emberjs 1.0-pre router can’t find state for path and says router is undefined

Any advice on this will be helpful. I want the template named data-template-name="logging to display the outlet named {{outlet mine }} . For now using this jsfiddle, only the template named data-template-name="application can display this named outlet, and i have to manually call App.router.transitionTo('root.logon.index') from the console for that to happen. I will want the named outlet to be displayed automatically without manually calling transitionTo

<script type="text/x-handlebars" data-template-name="application">
  <h1>Hi Friend</h1>
  {{outlet}}
  {{outlet mine }}

 <br/>
 <p><b>help</b></p>

 {{view  Ember.TextField placeholder="what" class="userInput"  }}
   <p> lets see</p>
    {{outlet mine }}

App.Router = Ember.Router.extend({
  enableLogging:  true,
  location: 'hash',
  root: Ember.Route.extend({

    showLogin: Ember.Route.transitionTo('root.logon'),

    index:  Ember.Route.extend({
      route:  '/',

      connectOutlets:  function(router){
      router.get('applicationController').connectOutlet('login');
    }

    }),

    logon:  Ember.Route.extend({
      route: '/login',
      enter: function ( router ){
        console.log("The login sub-state was entered.");
    },
     connectOutlets:  function(router, context){
       router.get('applicationController').connectOutlet( 'login');
     },


     index: Ember.Route.extend({
       route: '/',
       connectOutlets: function(router) {
      router.get('loginController').connectOutlet('mine', 'login');
     }
   })          

  })

 })     

});

Community
  • 1
  • 1
brg
  • 3,915
  • 8
  • 37
  • 66
  • Both of your recent questions are about named outlets.. have you seen [this](http://stackoverflow.com/questions/12150624/ember-js-multiple-named-outlet-usage)? – MilkyWayJoe Nov 08 '12 at 16:46
  • @MilkyWayJoe thanks for pointing out that link. I used that question as guide for creating the named outlet which you can see in the code that i pasted with this question as {{outlet mine }}. But thanks for still pointing it out. – brg Nov 08 '12 at 17:28
  • I'll try this out later. Just another thing that you might wanna do.. reference `ember-latest` instead of any pre release, as it usually has the latest bugfixes and enhancements. – MilkyWayJoe Nov 08 '12 at 18:25
  • 1
    thanks @MilkyWayJoe. I finally got everything working and since this question is related to my other question, i posted the solution there and will add **[the link here](http://stackoverflow.com/questions/13281815/emberjs-1-0-pre-router-cant-find-state-for-path-and-says-router-is-undefined)**. – brg Nov 09 '12 at 16:58

0 Answers0