Skip to content

Instantly share code, notes, and snippets.

View lpaulger's full-sized avatar

Lucas Paulger lpaulger

View GitHub Profile
'use strict';
angular.module('fontSize',[]).directive('adjustSizeToWidth',[function(){
var valueToAdjustFor, container, textSpan, originalFontSize;
return function(scope, elm, attr) {
originalFontSize = attr.vwOriginalFontSize;
valueToAdjustFor = attr.vwAdjustSizeToWidth;
scope.$watch(valueToAdjustFor, function(){
container = elm;
textSpan = elm.children()[0];
@lpaulger
lpaulger / quantity.js
Created September 7, 2013 15:20
A simple quantity spinner for angular
angular.module('__directives').directive('__Quantity', [
function() {
return {
restrict: "E",
scope: {
quantity: '='
},
replace: true,
templateUrl: 'templates/quantitySpinner.html',
link: function(scope, element, attrs) {