angular-ts-utils

0.0.8 • Public • Published

ts-utils

A package of open-sourceable angularjs utils

Installation

  1. bower install townsquared/utils
  2. load the utils.js
  3. angular.module('myApp', ['ts.utils'])

Utils

focusOn

Focuses an input on scope broadcasted event.

Specify the name of the broadcast event you would like to use to trigger the focusing.

<input focus-on="someEventName">
or
<input focus-on="focus-row-{{$index}}">
$scope.$broadcast('someEventName');
or
$scope.$broadcast('focus-row-'+$index);

scrollOn

Scroll to a certain point inside an overflowing DOM element on scope broadcasted event.

Specify the name of the broadcast event you would like to use to trigger scrolling.
Pass the location to scroll to as the data of the event.
Location: 'top' | 'bottom' | 200

<ul scroll-on="someEventName" style="overflow: auto">...</ul>
 var location = 'bottom';
 $scope.$broadcast('someEventName', location);

Package Sidebar

Install

npm i angular-ts-utils

Weekly Downloads

2

Version

0.0.8

License

ISC

Last publish

Collaborators

  • proloser