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', [
.component('loginControl', require('./directive/login-control'))
.component('loginForm', require('./directive/login-form').component)
.component('publishAnnotationBtn', require('./directive/publish-annotation-btn'))
.component('timestamp', require('./directive/timestamp'))
.directive('excerpt', require('./directive/excerpt').directive)
.directive('formInput', require('./directive/form-input'))
......@@ -166,7 +167,6 @@ module.exports = angular.module('h', [
.directive('svgIcon', require('./directive/svg-icon'))
.directive('tagEditor', require('./directive/tag-editor'))
.directive('threadList', require('./directive/thread-list'))
.directive('timestamp', require('./directive/timestamp'))
.directive('topBar', require('./directive/top-bar'))
.directive('windowScroll', require('./directive/window-scroll'))
......
......@@ -11,7 +11,7 @@ describe('timestamp', function () {
before(function () {
angular.module('app',[])
.directive('timestamp', require('../timestamp'));
.component('timestamp', require('../timestamp'));
});
beforeEach(function () {
......
......@@ -42,13 +42,10 @@ function TimestampController($scope, time) {
};
}
module.exports = function () {
return {
bindToController: true,
module.exports = {
controller: TimestampController,
controllerAs: 'vm',
restrict: 'E',
scope: {
bindings: {
className: '<',
href: '<',
timestamp: '<',
......@@ -56,5 +53,4 @@ module.exports = function () {
template: ['<a class="{{vm.className}}" target="_blank" ng-title="vm.absoluteTimestamp"',
' href="{{vm.href}}"',
'>{{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