Sha256: a70119355053ff75a9b8e51008327b1b68e493b6801378cdbf1a08accc6b08fb
Contents?: true
Size: 832 Bytes
Versions: 16
Compression:
Stored size: 832 Bytes
Contents
;(function() { "use strict"; // Displays pertinent information about a profile. function profileStatus() { return { template: '<h2>{{ profile.username }}</h2>' + '<h3 ng-class="profile.isAdmin ? \'invisible\' : \'\'">' + '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
16 entries across 16 versions & 1 rubygems