https://github.com/pocesar/angular-unamed-scroll
Scroll to elements on page without relying on IDs. Adds named elements to the service, then scroll to them anywhere in your code
https://github.com/pocesar/angular-unamed-scroll
Last synced: about 1 year ago
JSON representation
Scroll to elements on page without relying on IDs. Adds named elements to the service, then scroll to them anywhere in your code
- Host: GitHub
- URL: https://github.com/pocesar/angular-unamed-scroll
- Owner: pocesar
- License: mit
- Created: 2015-08-09T11:01:00.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-08-09T12:47:13.000Z (almost 11 years ago)
- Last Synced: 2025-03-29T00:34:25.288Z (over 1 year ago)
- Language: TypeScript
- Size: 188 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# angular-unamed-scroll
Scroll to elements on page without relying on IDs. Adds named elements to the
service, then scroll to them anywhere in your code.
It's actually an oxymoron. You name your elements, you just don't rely on the ID attribute.
## Install
```bash
bower install angular-unamed-scroll
```
## Usage
HTML
```html
```
JS
```js
angular
.module('YourApp', ['UnamedScroll'])
.controller('SomeCtrl', ['UnamedScroll', function(UnamedScroll){
this.go = function(name){
UnamedScroll.scrollTo(name).then(function(exists){
// exists will be true if the element exists, false otherwise
// so it's safe to call when the element doesn't exist on the page
});
};
}])
;
```
## License
MIT