Can I use jQuery code in a . Factory and inject it into the controller?

Asked

Viewed 37 times

1

I’m developing a site using Angularjs ES6, and on this site I needed to perform a function and I wasn’t getting it. I searched the internet for a similar function to understand how I could do and found a function in jQuery.

In the attempt to pass this code in the controller of my page appeared some syntax errors and found that I can’t use jQuery with ES6 (correct me if I’m wrong). So what did I do? I went to the services screen, where I call WCF services (.Factory), played the code there, injected the controller and it worked.

My question is this, even though it worked, is that correct? I can do this when I want to use jQuery or have to transform this jQuery code to Javascript and use only the controller?

  • Hello, td well? Please explain? What code do you want to use from Jquery? It’s not very nice to mix the 2. Angular and Jquery. Vc is using either Angular 2 (4 or 5) or Angular 1 (Angularjs)?

  • jQuery has nothing to do with ES6.

  • It is a code that pulls the data from an excel spreadsheet and creates a table in the template, I could only find in jQuery :/

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.