0

Hi I am new in ember I tried to solve my self but no success.

Take a look at code:

// works 
window.App = Em.Application.create();
window.Core = Em.Namespace.create({ Beta: Em.Namespace.create() });

App.Router.map(function() {
    this.route("registration", {
        path: "/beta/registration"
        }); // also Core.Beta.registration tried
});

App.IndexRoute = Em.Route.extend({
    redirect: function() {
        this.transitionTo('registration'); // also Core.Beta.registration tried
    }
});

// never is called
Core.Beta.RegistrationController = Em.Controller.extend();
Core.Beta.RegistrationView = Em.View.extend({ template: Em.TEMPLATES['beta.regisration'] });

Core.Beta.RegistrationRoute = Em.Route.create({
    setupController: function() {
        console.log(arguments);
    },
    setupView: function() {
        console.log(arguments);
    }
});

All inside Core.Beta never is called as should in ember pre4... Using Core.Beta I can generate reusable micro apps to use in other projects. Do you know the way how ember inject that app in router so it could create instances inside the namespaces.

carlitux
  • 1,207
  • 9
  • 14
  • You can go through the suggested approaches here incase any meets your use case. http://stackoverflow.com/questions/14033765/best-way-to-namespace-multiple-or-suit-of-emberjs-apps – brg Feb 05 '13 at 23:28

1 Answers1

0

You need to create your namespace within the App itself

window.App = Em.Application.create();
window.App.Core = Em.Namespace.create({ Beta: Em.Namespace.create() });
ken
  • 3,675
  • 6
  • 31
  • 45
  • Hi ken, in some way this could be my last option because I want to reuse that namespace into another project. But also doesn't work https://github.com/emberjs/ember.js/issues/683 – carlitux Jan 24 '13 at 21:52