Understanding the Autoscroll Attributes of the ng-include Directive

Asked 2 years ago, Updated 2 years ago, 77 views

If you include the autoscroll attribute in the ng-include directive as follows, auto-scroll does not work:
<div ng-include="temp" autoscroll></div>

autoscroll="
The same goes for

If you look at the document, it says that the autoscroll attribute is set to scroll to the location of the loaded part.

If anyone knows, please let me know.

angularjs

2022-09-30 18:00

1 Answers

It seems to say that the autoscroll attribute is set to scroll to the location of the loaded part.

The autoscroll attribute is not a feature that autoscrolls ng-include to a specified element, but
Set whether to use the $anchorScroll scrolling feature

This $anchorScroll looks for an element with an ID that matches the value of $location.hash() and
If present, it scrolls to the location of the element.

http://jsfiddle.net/xsdauxn7/
I made a sample above, so please refer to it


2022-09-30 18:00

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.