1

I think this is something silly I'm missing, but please tell me what's wrong..

Controller.js

({
    doInit: function(component, helper, event) {
        helper.runSetup();
}
})

Helper.Js

({
  runSetup : function() {
    console.log('test');
  }
})

and I'm getting error as:

Action failed: c:IB_Preferences_UI_Sector$controller$doInit [helper.runSetup is not a function]]

every single time...

This is really frustrating, because I've done that before on other projects and it was fine. And suddenly it stopped..

Any ideas?

5

your Controller Should be

({
    doInit: function(component, event, helper) {
        helper.runSetup();
}
})

Actually you have interchanged the position of attributes passed.

In your controller attribute value should be in this order. But in your helper you can decide in whatever order you want to transfer the attributes.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.