jeudi 28 janvier 2016

Create a custom function in ember controller

I have created a function for my ember app which do some calculation.But I am not able to use it.

Controller.js

import Ember from 'ember';
export default Ember.Controller.extend({
   ScaleImage(data) { 
      //maniplution with data 
   },
   feedResult:Ember.computed('model',function() {
      dimension = ScaleImage(data);
   });
});

It throws an error

Uncaught ReferenceError: ScaleImage is not defined

If I put function in separate file inside the bower_component and then call the function.It works fine.I want to include the function in my ember project.Because I think while building the ember app and delopying it.The separate function file will be left.




Aucun commentaire:

Enregistrer un commentaire