Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-unamed-scroll

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

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

bower install angular-unamed-scroll

Usage

HTML

<div ng-controller="SomeCtrl as ctrl">
    <div unamed-scroll="name"></div>

    <a ng-click="ctrl.go('name')"></a>
</div>

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

Keywords

FAQs

Package last updated on 09 Aug 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc