I'm trying to create a nav menu where when you scroll to a section the "selected" navigation changes. I'm using JQuery for the scroll triggers, but I can't seem to call $(window) from inside the controller. I have a nav specific controller which binds a variable "selected" to which nav is selected. So I'm not sure how I should go about building. Essentially I need to access my nav.selected in the controller, but I seem to need to be outside of the controller in order to use $(window) in jquery...
Could someone give me an explanation on how I may go about this? Thank you.
Have you tried using angularJS window provider?
https://docs.angularjs.org/api/ng/service/ $window
It should allow you to use window javascript object inside angular.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.