As the saying goes: good memory than a rotten pen, this article on the Angularjs module to learn notes, first of all, we start from the Anchor scroll study, the specific content please see below:
• $anchorScroll () to jump to the definition ID;
• The hash () method of the $location object replaces the current URL as the hash key;
• $anchorScroll () Read and jump to ID.
The following simple example, here is the output result:
Source index.html--11 line, marked by the Jump ID:
App.js
var demoApp = angular.module ("App", [])
. Controller ("Mockcontroller",
function ($scope, $location, $ Anchorscroll) {
$scope. Numbers = {
"natural number": ["", "", "", "", "", "", "", "", "", "" "," "", "", "", "", "", "", "", "", "", "" " "Prime number": ["," "," "," "," "," "," ",", "", "", "", "", "" "
]
};
$scope. Jumper = function (key) {
$location. hash (key);
$anchorScroll ();
}
});
The above is a small set up for everyone to organize the Angularjs module learning anchor Scroll related content, I hope you like.