Commit 93c6e52e authored by Robert Knight's avatar Robert Knight

Convert <timestamp> to a component

parent 9e362629
...@@ -146,6 +146,7 @@ module.exports = angular.module('h', [ ...@@ -146,6 +146,7 @@ module.exports = angular.module('h', [
.component('loginControl', require('./directive/login-control')) .component('loginControl', require('./directive/login-control'))
.component('loginForm', require('./directive/login-form').component) .component('loginForm', require('./directive/login-form').component)
.component('publishAnnotationBtn', require('./directive/publish-annotation-btn')) .component('publishAnnotationBtn', require('./directive/publish-annotation-btn'))
.component('timestamp', require('./directive/timestamp'))
.directive('excerpt', require('./directive/excerpt').directive) .directive('excerpt', require('./directive/excerpt').directive)
.directive('formInput', require('./directive/form-input')) .directive('formInput', require('./directive/form-input'))
...@@ -166,7 +167,6 @@ module.exports = angular.module('h', [ ...@@ -166,7 +167,6 @@ module.exports = angular.module('h', [
.directive('svgIcon', require('./directive/svg-icon')) .directive('svgIcon', require('./directive/svg-icon'))
.directive('tagEditor', require('./directive/tag-editor')) .directive('tagEditor', require('./directive/tag-editor'))
.directive('threadList', require('./directive/thread-list')) .directive('threadList', require('./directive/thread-list'))
.directive('timestamp', require('./directive/timestamp'))
.directive('topBar', require('./directive/top-bar')) .directive('topBar', require('./directive/top-bar'))
.directive('windowScroll', require('./directive/window-scroll')) .directive('windowScroll', require('./directive/window-scroll'))
......
...@@ -11,7 +11,7 @@ describe('timestamp', function () { ...@@ -11,7 +11,7 @@ describe('timestamp', function () {
before(function () { before(function () {
angular.module('app',[]) angular.module('app',[])
.directive('timestamp', require('../timestamp')); .component('timestamp', require('../timestamp'));
}); });
beforeEach(function () { beforeEach(function () {
......
...@@ -42,13 +42,10 @@ function TimestampController($scope, time) { ...@@ -42,13 +42,10 @@ function TimestampController($scope, time) {
}; };
} }
module.exports = function () { module.exports = {
return {
bindToController: true,
controller: TimestampController, controller: TimestampController,
controllerAs: 'vm', controllerAs: 'vm',
restrict: 'E', bindings: {
scope: {
className: '<', className: '<',
href: '<', href: '<',
timestamp: '<', timestamp: '<',
...@@ -56,5 +53,4 @@ module.exports = function () { ...@@ -56,5 +53,4 @@ module.exports = function () {
template: ['<a class="{{vm.className}}" target="_blank" ng-title="vm.absoluteTimestamp"', template: ['<a class="{{vm.className}}" target="_blank" ng-title="vm.absoluteTimestamp"',
' href="{{vm.href}}"', ' href="{{vm.href}}"',
'>{{vm.relativeTimestamp}}</a>'].join(''), '>{{vm.relativeTimestamp}}</a>'].join(''),
};
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment