Angularjs - Where to put Jquery/Javascript functions

Asked

Viewed 65 times

2

I have some functions in jquery that normally would be in a file . js even, but when I use Angular where should put, following good practices?

Example: I have a function that determines whether or not my Header is hidden depending on scroll size.

1 answer

3


There’s nothing in the Angular specification that forces the location of a feature file with extra functionality.

If you’re not consuming anything from Angular and Angular doesn’t expect anything from you, leave the code aside anyway.

  • Another thing, I’m consuming db so the correct thing would be to put my functions in Controller?

  • @Charlespresident This will depend mainly on the way you are implementing the connection between your application and the bank, but in general terms resource accesses are centralized in services/Factories.

Browser other questions tagged

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