0

I have two separat JS-files: an AngularJS(1.4x) Controller someController.js, and custom-class.js, which contains the class CustomClass.

I would like to access CustomClass and its functions from within the Controller.

Can that be achieved by using import inside the Controller and export in the corresponding file? If not, what options do I have, instead?

2
  • I'll try to use the class as a script, by including it in my index.html. Commented Oct 27, 2019 at 4:21
  • I tried passing the Class to a Service, and then use it in said controller. I ran into some trouble with that, which I described in another Post: Passing a JS Class to an AngularJS Service Commented Oct 29, 2019 at 13:39

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.