Sha256: 573f8021c93a9bfcadf57db9c2228fa3976f45429d9fd7d43ae66c01521934cb
Contents?: true
Size: 738 Bytes
Versions: 4
Compression:
Stored size: 738 Bytes
Contents
;(function() { "use strict"; // Displays pertinent information about a profile. function profileStatus() { return { template: '<h2>{{ profile.username }}</h2>' + '<h3>Last seen: {{ profile.latestAction | timeFromNow }}</h3>' }; } // Listen for 'focusOn' event and focus on the input. function focusOn() { return function(scope, elem, attr) { return scope.$on('focusOn', function(e, name) { if (name === attr.focusOn) { return elem[0].focus(); } }); }; } // Create a module and register the directives. angular.module('socialNetworking.directives', []) .directive('profileStatus', profileStatus) .directive('focusOn', focusOn); })();
Version data entries
4 entries across 4 versions & 1 rubygems