vendredi 26 août 2016

call controller from model ember js

I am new to ember and How can I call controller from model.

structure

ember
-source
--controllers
---controller1(method1)
--models
---model1 --(Call controller1.method1)
--routes
--views
--router.js
--appname-app.js

I tried these ways

var subs= AppName.controller1.method1();



var cd = Soni.controller1.create(); 
var subs = cd.method1();



var controller = $(this).get('controllers.controller1');
var subs = controller.method1();

Error: ember.min.js:205 Uncaught TypeError: AppName.controller1.method1() is not a function

Where exactly am I doing wrong?




Aucun commentaire:

Enregistrer un commentaire