Hi Everybody,
long story short: i do have set up a LoginView (which gets rendered well) with a click event-handler defined. In this handler i want to send this event to the LoginController (which is defined and being loaded with requireJS).
The Problem ist, that it gets sent to the ApplicationController instead of the LoginController.
I’am aware of Naming Conventions. But what am i doing wrong here?
(For “Trial-and-Error” i put the LoginController-Definition inside the LoginView.js; same result. If i could fix the problem with the LoginController being inside the LoginView.js it shouldnt be big deal to move it to the LoginView.js, i guess…)
define([
"Ember",
"App",
"text!Template/LoginTemplate.htm"
], function(Ember, App, LoginTemplate) {
App.LoginView = Ember.View.extend({
template: Ember.Handlebars.compile(LoginTemplate),
click: function(event)
{
console.log(this.get("controller"));
this.get("controller").submit();
}
});
App.LoginController = Ember.Controller.extend({
submit: function()
{
alert("LoginController");
}
});
App.ApplicationController = Ember.Controller.extend({
submit: function()
{
alert("ApplicationController");
}
});
return App.LoginView;
});
Many thanks in Advance for any Tip. I would love to get closer to the concepts of Ember.js!
Cheers,
Fabi.